Compare commits

...

451 Commits

Author SHA1 Message Date
6f7bda9f0a indexAction adjusted so that users who are only admin will still go to admin homepage. 2022-03-10 15:15:14 +01:00
c34c8035ea csfixes 2022-03-10 14:54:03 +01:00
a3c5cabc9a entry added to section menu and redirection to normal chill homepage 2022-03-10 14:53:46 +01:00
0fc3c2eb1f fix display of checkbox field in user form 2022-03-10 10:38:01 +01:00
3ebeda9840 role field added to user form. Works with select or radio button, not with checkbox... 2022-03-09 15:49:50 +01:00
1453fdcd18 default value set in migration 2022-03-09 15:48:48 +01:00
0a4abe9b8d roles property added to user, migration does not want to execute due to null value not allowed 2022-03-08 15:48:22 +01:00
d18ab5cf49 fix display of email in person renderbox if null or empty string 2022-03-08 11:00:31 +01:00
efbd9b0185 do not allow to remove doc or evaluations if workflow is associated 2022-03-07 00:30:53 +01:00
b2a61071bf create voter which blocks deletion if a workflow exists 2022-03-07 00:30:53 +01:00
f0849eeef5 Merge branch 'issue484_link_household' into 'master'
add current household link to person banner

See merge request Chill-Projet/chill-bundles!369
2022-03-06 21:58:37 +00:00
c7f2eedd4b Merge remote-tracking branch 'origin/master' into issue484_link_household 2022-03-06 22:57:12 +01:00
ab74478afc Merge branch 'issue478_remove_localisation' into 'master'
fix parcours localisation

See merge request Chill-Projet/chill-bundles!368
2022-03-06 21:56:04 +00:00
f88d0ee19e Merge remote-tracking branch 'origin/master' into issue478_remove_localisation 2022-03-06 22:54:48 +01:00
727480d6d1 Merge branch 'issue472_filter_job_user_in_set_referrer' into 'master'
assign User to undispatched acc period: filter users by job type

See merge request Chill-Projet/chill-bundles!367
2022-03-06 21:52:43 +00:00
af79ffd544 Merge remote-tracking branch 'origin/master' into issue472_filter_job_user_in_set_referrer 2022-03-06 22:40:14 +01:00
80aee185a7 Merge branch 'url_in_accompanyingPeriodWork_evaluations' into 'master'
Url in accompanying period work evaluations

See merge request Chill-Projet/chill-bundles!364
2022-03-06 21:37:27 +00:00
7afada5dad fix cs 2022-03-06 22:36:38 +01:00
739c7e9a77 Merge remote-tracking branch 'origin/master' into url_in_accompanyingPeriodWork_evaluations 2022-03-06 22:33:16 +01:00
03471a74fe fix creating alt phonenumber 2022-03-06 22:28:33 +01:00
44ed2e44e0 another way to fix phonenumber and telephone in third party / OnTheFly 2022-03-06 22:16:48 +01:00
3352999862 rebase onto master 2022-03-04 17:23:37 +01:00
5605813826 Update changelog 2022-03-04 17:22:27 +01:00
72795240b9 Add current household link in person banner 2022-03-04 17:22:06 +01:00
d0772fc306 Add email to twig personRenderBox 2022-03-04 17:08:41 +01:00
9265a15427 Update changelog 2022-03-03 21:12:00 +01:00
6d3b88aee9 Add current household link in person banner 2022-03-03 21:09:50 +01:00
827c85ac56 fix parcours localisation 2022-03-03 20:37:12 +01:00
nobohan
7b52a10943 upd CHANGELOG 2022-03-03 17:21:54 +01:00
nobohan
187c9d82b6 assign User to undsipatched acc period: filter users by job type 2022-03-03 16:37:58 +01:00
e9236875d2 quick fix for phonenumber alt on person 2022-03-03 15:44:30 +01:00
db4b0b104b Merge branch 'issue464_document_on_person' into 'master'
Person Document generation

See merge request Chill-Projet/chill-bundles!360
2022-03-03 14:27:53 +00:00
4ad65b616d fix tests for person json normalizer and residential address stuff 2022-03-03 15:20:21 +01:00
nobohan
c5eac09478 php cs fix on migration 2022-03-03 15:17:05 +01:00
nobohan
a88e052eb6 upd CHANGELOG 2022-03-03 15:12:47 +01:00
nobohan
568a1d95f4 AccompanyingCourseWorkEdit: add url to vuejs form 2022-03-03 15:10:05 +01:00
9769aa1386 fix loading of residential address form type 2022-03-03 15:07:45 +01:00
bf4a3a2c91 add id to docgen normalization fo a person 2022-03-03 15:01:14 +01:00
3df2335cf4 Merge remote-tracking branch 'origin/master' into issue464_document_on_person 2022-03-03 14:42:06 +01:00
1c7c217d1c Merge branch 'issue470_location_in_activity_validation' into 'master'
activity: do not override location if already exist (when validating new activity)

See merge request Chill-Projet/chill-bundles!363
2022-03-03 13:40:43 +00:00
f0e41f839f fix error when context is a string in personJsonNormalizer 2022-03-03 14:39:20 +01:00
nobohan
349db2142d person: add url field to SocialWork Evaluation entity + populate with http title values 2022-03-03 14:39:00 +01:00
b1c0e18e51 Merge remote-tracking branch 'origin/master' into issue470_location_in_activity_validation 2022-03-03 13:59:44 +01:00
6edf0bcb3b fix delete links in documents 2022-03-03 13:57:00 +01:00
6171b3411f fix creation of document when overriding center resolver 2022-03-03 13:07:36 +01:00
86bf0115dd fix condition when empty phonenumber 2022-03-03 13:05:01 +01:00
nobohan
1b66941746 upd CHANGELOG 2022-03-03 12:05:55 +01:00
nobohan
dca17c409b activity: do not override location if already exist (when validating new activity) 2022-03-03 12:03:22 +01:00
nobohan
23fd4be2e5 upd CHANGELOG 2022-03-03 10:17:29 +01:00
nobohan
4406016f82 code fix for PersonContext 2022-03-03 10:17:16 +01:00
d50d68aa86 Merge branch 'issue439_residential_address_otf' into 'master'
residential address in OnTheFly

See merge request Chill-Projet/chill-bundles!350
2022-03-02 20:58:19 +00:00
fccac80222 Merge remote-tracking branch 'origin/master' into issue439_residential_address_otf 2022-03-02 21:53:17 +01:00
bf70d344bf remove missing error on phpstan 2022-03-02 21:45:14 +01:00
d0591d0351 Merge branch '20-update-telephone-type-new-approach' into 'master'
fix: Use `odolbeau/phone-number-bundle` for formatting phone number type fields.

See merge request Chill-Projet/chill-bundles!322
2022-03-02 20:39:52 +00:00
c83d6d392f [docgen/template] do not list template wich are inactive
See https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/473
2022-03-02 21:35:16 +01:00
09ca1ec6bb fix phstan error 2022-03-02 21:23:05 +01:00
970431197f display phonenumber in tel link 2022-03-02 21:19:44 +01:00
9fdd9da486 display phonenumber and mobilenumber in search results 2022-03-02 21:10:37 +01:00
b9eee51de6 fix cs 2022-03-02 21:02:58 +01:00
c0ec64e4be add leadiing country code while seraching numbers 2022-03-02 21:02:32 +01:00
74a84e42a6 update changelog and csfixes 2022-03-02 19:24:33 +01:00
595ddf5b6f fix display of thirdparty contact badges in twig template 2022-03-02 19:20:26 +01:00
abe183fd10 fix position of toggle button
so it doesn't cover content or falls outside box
2022-03-02 19:11:34 +01:00
9a0883eb5f Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-02 18:08:16 +01:00
663295d436 fix edit name of thirdparty 2022-03-02 18:07:55 +01:00
9f9986d367 Merge branch 'issue475_bug_graphique' 2022-03-02 17:38:20 +01:00
db37527f72 try to resolve bug with flot-button.bottom placement (2) 2022-03-02 17:36:24 +01:00
6171a221b2 fix cs 2022-03-02 16:59:20 +01:00
1312fd0941 allow psalm to fail 2022-03-02 16:41:53 +01:00
c1832d39f1 remove fixed phpstan issue 2022-03-02 16:40:50 +01:00
3756631595 fix some psalm issues 2022-03-02 16:39:36 +01:00
a7a933c7a7 fix test for phonenumber update: desactivate temporarily 2022-03-02 16:32:28 +01:00
15bc3e62d3 fix cs 2022-03-02 16:29:21 +01:00
5ce62f5458 phonenumber helper: remove unused method and fix tests 2022-03-02 16:27:55 +01:00
3e30684198 normalization on 3party phone 2022-03-02 16:19:02 +01:00
c2e284682f phonenumber on 3party: twig stuffs 2022-03-02 16:13:17 +01:00
5407dbfc98 form for third party telephone 2022-03-02 16:05:08 +01:00
fa23bfd7d5 fix upgrade formula for phonenumber 2022-03-02 16:02:23 +01:00
09de7cbf7d allow null values on phonenumber in location and person 2022-03-02 15:53:39 +01:00
6a3c8017f0 upgrade phonenumber on 3party: migrations 2022-03-02 15:50:01 +01:00
eb6ec8a4af apply phonenumber on locations 2022-03-02 15:08:16 +01:00
c8c2c4c859 phonenumber type for form 2022-03-02 15:01:04 +01:00
7bd93e53c2 fix formatting upgrade clause 2022-03-02 14:23:50 +01:00
5d6f3de694 normalize phonenumber in person docgen normalizer 2022-03-02 14:22:12 +01:00
3eb826d422 default value for Phonenumbers 2022-03-02 14:21:53 +01:00
e9ffdb1f03 fix cs 2022-03-02 14:11:47 +01:00
f4f488dad1 normalization of phonenumber 2022-03-02 14:10:48 +01:00
2a9f1dc238 restore templating class 2022-03-02 13:51:19 +01:00
8482c8ffa7 update app 2022-03-02 13:50:35 +01:00
54ad7a4b8f restore showing phonenumber 2022-03-02 13:48:48 +01:00
ed4cf67e79 set carrier code parameter and lint existing phonenmubers 2022-03-02 13:01:01 +01:00
550168fd7c Merge branch 'issue475_bug_graphique' 2022-03-02 13:00:51 +01:00
8470430c57 try to resolve bug with flot-button.bottom placement 2022-03-02 13:00:23 +01:00
a9415488dd Merge branch 'list_documents_page' 2022-03-02 09:55:16 +01:00
8945703785 fix template mistakes 2022-03-02 09:53:51 +01:00
9f90cc8fe1 Merge remote-tracking branch 'origin/master' into 20-update-telephone-type-new-approach 2022-03-01 16:55:33 +01:00
nobohan
d6d7edf25d Add doc generation for PersonDocument form 2022-03-01 16:14:21 +01:00
7b17dc692e Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-01 16:14:00 +01:00
e5f7120733 Merge branch 'list_documents_page' 2022-03-01 16:13:20 +01:00
1a05ffab96 fix flex item-col placement for documents list 2022-03-01 16:13:11 +01:00
aad7a21bc3 Merge branch 'list_documents_page' 2022-03-01 16:09:10 +01:00
ae0bf7bfd7 fix flex item-col placement for documents list 2022-03-01 16:08:52 +01:00
d2ecc5d3a3 Merge branch 'issue442_toggle_emergency' into 'master'
Toggle emergency only by referrer

See merge request Chill-Projet/chill-bundles!331
2022-03-01 15:02:01 +00:00
22aefca5c9 Merge remote-tracking branch 'origin/issue442_toggle_emergency' into issue442_toggle_emergency 2022-03-01 15:58:20 +01:00
cce790f2f8 add validator which force confidential course to keep a referrer 2022-03-01 15:55:18 +01:00
nobohan
84478c651e Person: remove useless serialisation groups 2022-03-01 15:54:36 +01:00
nobohan
88e9a96e0e Person document generation: clean build Admin form + add household and relations groups 2022-03-01 15:51:34 +01:00
nobohan
a187bac7b0 DocGeneratorTemplateController: fix in case there is no public form 2022-03-01 15:48:32 +01:00
2b108d0d70 update changelog 2022-03-01 15:32:47 +01:00
f5accb827c fix inline address -> reopen issue462 2022-03-01 15:27:18 +01:00
nobohan
4543c411e7 quick fix: remove duplicate email info in PersonRenderBox.vue 2022-03-01 15:24:44 +01:00
nobohan
7aefa5014c Add docgen:read group on Person + 2 fields in PersonContext admin form 2022-03-01 15:17:17 +01:00
nobohan
d163783ed3 Person Document: add a PersonContext class 2022-03-01 15:17:17 +01:00
4536f30da2 Merge branch 'list_documents_page' 2022-03-01 15:11:01 +01:00
8764aacd92 fix confusion between document dates 2022-03-01 15:03:21 +01:00
8b8f6027cc Merge remote-tracking branch 'origin/master' into issue442_toggle_emergency 2022-03-01 14:52:56 +01:00
6769752c26 merge with master 2022-03-01 14:40:14 +01:00
nobohan
5695bb0e9e add missing key in v-for loop 2022-03-01 14:36:47 +01:00
nobohan
48a32f2403 residential address: filter by person in the repository 2022-03-01 14:36:22 +01:00
nobohan
a7240e8cc6 PersonJsonNormalizer: fix circular reference with residential address 2022-03-01 14:15:39 +01:00
52d8776fbb Merge branch 'list_documents_page' 2022-03-01 11:34:07 +01:00
0d38cae217 fix macro metadata + fix merge conflicts from branch ux_corrections 2022-03-01 11:33:33 +01:00
Pol Dellaiera
b146f17d2f Update twig function isEditable. 2022-03-01 09:58:57 +01:00
df675cd757 Merge branch 'issue463' into 'master'
issue 463: add delete button on draft periods page

See merge request Chill-Projet/chill-bundles!361
2022-03-01 08:50:23 +00:00
ecc2e390f7 Merge remote-tracking branch 'origin/master' into issue463 2022-03-01 09:48:19 +01:00
c3e0b3b708 Merge branch 'issue458_ChillCollectionType' into 'master'
ChillCollectionType: fix bug when adding 2 new items in an empty collection

See merge request Chill-Projet/chill-bundles!359
2022-03-01 08:47:01 +00:00
449a6a1b4e Merge remote-tracking branch 'origin/master' into issue458_ChillCollectionType 2022-03-01 09:28:44 +01:00
eb874a15a6 Merge branch 'issue366_modal_thirdparty' into 'master'
Thirdparty renderbox improvements

See merge request Chill-Projet/chill-bundles!356
2022-03-01 08:24:54 +00:00
3b26466a6c remove duplicate key in thirdparty serializer 2022-02-28 20:07:13 +01:00
a6ac6ee6d8 fix merge conflicts 2022-02-28 19:47:22 +01:00
06c279627a Merge remote-tracking branch 'origin/master' into workflow/fixes-2022-02 2022-02-28 16:29:57 +01:00
1e146f542e try to fix some things 2022-02-28 16:09:52 +01:00
cdd21c94c6 Merge remote-tracking branch 'origin/master' into issue439_residential_address_otf 2022-02-28 15:11:50 +01:00
Pol Dellaiera
30cdcb0836 serializer update 2022-02-28 15:01:26 +01:00
Pol Dellaiera
29308110ea Templating 2022-02-28 15:01:26 +01:00
Pol Dellaiera
18c57d532c Update Person entity fixup 2022-02-28 15:01:26 +01:00
Pol Dellaiera
b814e812b6 Update migrations. 2022-02-28 15:01:26 +01:00
Pol Dellaiera
dbbbd99788 Use PhoneNumber form type. 2022-02-28 15:01:26 +01:00
Pol Dellaiera
47676c67ff Add doctrine phone_number type. 2022-02-28 15:01:26 +01:00
Pol Dellaiera
7ad78fbce1 remove regex 2022-02-28 15:01:26 +01:00
Pol Dellaiera
37e38436a8 Try to add placeholder 2022-02-28 15:01:24 +01:00
Pol Dellaiera
e1b3719746 Tests 2022-02-28 15:00:56 +01:00
Pol Dellaiera
68a64aa67f fixup PhoneNumberHelper 2022-02-28 15:00:55 +01:00
Pol Dellaiera
d780d95157 work in progress 2022-02-28 15:00:55 +01:00
Pol Dellaiera
4822acb6fb fix: Use odolbeau/phone-number-bundle for formatting phone number type fields.
There is no need to use the bundle, we could have used the library instead. However, this idea is to switch to that bundle at some point.
2022-02-28 15:00:55 +01:00
260ce8ba17 issue 463: add delete button on draft periods page 2022-02-28 14:47:35 +01:00
822f0aa737 fix cs 2022-02-28 14:38:25 +01:00
e10a6b4bf2 Merge branch 'issue441_enfant_confie' 2022-02-28 14:37:38 +01:00
8e1f3a5cc0 Merge branch 'issue345_internal_thirdparty_contact' into 'master'
Add contact to thirdparty from within modal

See merge request Chill-Projet/chill-bundles!284
2022-02-28 13:28:13 +00:00
31ec6c70ef fix cs 2022-02-28 14:27:31 +01:00
cd84700400 Merge branch 'ux_corrections' 2022-02-28 14:23:54 +01:00
08fa1edbee Merge remote-tracking branch 'origin/master' into issue345_internal_thirdparty_contact 2022-02-28 14:22:52 +01:00
15d9593d0f design correction on list documents page 2022-02-28 14:22:15 +01:00
010afded18 order civilities 2022-02-28 13:56:52 +01:00
c12f633829 fixes 2022-02-28 13:52:41 +01:00
fb6f0c316e update changelog 2022-02-28 12:22:17 +01:00
b1ed263c4e add email in personrenderbox 2022-02-28 12:18:58 +01:00
846e487e27 fix display of address in renderbox 2022-02-28 12:13:58 +01:00
72a9183ca8 fix in case of no profession 2022-02-28 12:04:05 +01:00
fe89704672 Merge remote-tracking branch 'origin/master' into issue345_internal_thirdparty_contact 2022-02-28 11:39:16 +01:00
93d023007e Merge branch 'issue388_order_social_issues' into 'master'
person: rewrite social issue api controller for ordering

See merge request Chill-Projet/chill-bundles!323
2022-02-28 10:38:24 +00:00
8bf179934d update psalm to ignore new error (sorry) 2022-02-28 11:37:03 +01:00
24c79cc4b1 fix merge conflicts 2022-02-28 10:20:29 +01:00
f93282d657 fix cs 2022-02-28 10:13:00 +01:00
3a602385cc Merge remote-tracking branch 'origin/master' into issue388_order_social_issues 2022-02-28 09:51:40 +01:00
cb4c3b46b9 fix creating two workflow on accompanying period work 2022-02-27 03:03:29 +01:00
abb81bf45f remove console log 2022-02-27 02:44:01 +01:00
a9694da557 add workflow on evaluationdocument in UI 2022-02-27 02:38:08 +01:00
nobohan
d205939361 ChillCollectionType: fix bug when adding 2 new items in an empty collection 2022-02-25 17:52:20 +01:00
af0d7765ff fixes for adding evaluation document 2022-02-25 16:13:31 +01:00
c1f5730c4d Merge remote-tracking branch 'origin/issue466_file_upload' into workflow/fixes-2022-02 2022-02-25 15:40:38 +01:00
da019a146a finalize handling workflow for evaluation document 2022-02-25 15:40:23 +01:00
nobohan
4bd50d0148 fix code style for AccompanyingPeriodWorkEvaluation 2022-02-25 15:31:24 +01:00
nobohan
1826b20b40 upd CHANGELOG 2022-02-25 15:26:08 +01:00
356d1a7133 fix usage of workflow handler title in show workflow page 2022-02-25 15:18:01 +01:00
nobohan
2cc7473276 more tentative to correct AccPeriodWorkEvaluationDenormalizer 2022-02-25 15:06:16 +01:00
nobohan
2ea5c4b0c7 fix error when using AccPeriodWorkEvaluationDenormalizer 2022-02-25 14:58:11 +01:00
432cce280b simplify showing title of workflow, and add handler for evaluationDocument 2022-02-25 14:02:36 +01:00
530297bc67 csfixes 2022-02-25 13:59:05 +01:00
c416f1ef6d fix bug to resolve onthefly component within thirdparty renderbox 2022-02-25 13:58:17 +01:00
3a5e956e49 updated changelog 2022-02-25 13:20:46 +01:00
5cf4013a99 cs fixes 2022-02-25 13:12:25 +01:00
16cca07e12 throw 403 error instead of 422 and display toast message 2022-02-25 13:11:30 +01:00
nobohan
aae360d6ab AccCourseWorkEdit: remove documents in vuejs form 2022-02-25 12:45:18 +01:00
bf25740098 list for workflows: previous and old workflows 2022-02-25 12:43:04 +01:00
18836f312a fix cs 2022-02-25 12:11:05 +01:00
2b257cc402 improve title rendering on workflows 2022-02-25 12:09:53 +01:00
nobohan
289d79e011 AccCourseWorkEdit: fix setting title on documents 2022-02-25 11:52:04 +01:00
b7d6d69101 list workflow on index pages 2022-02-25 11:51:28 +01:00
nobohan
15487cd84c Add AccompanyingPeriodWorkEvaluationDenormalizer 2022-02-25 11:10:14 +01:00
1479e2ae9a entity workflow: handle sending an access key by email 2022-02-24 21:53:05 +01:00
nobohan
1ab4f997ba AccompanyingPeriodWork: add title in vue AccPeriodWorkEvaluationDocument form 2022-02-24 17:38:29 +01:00
nobohan
24b11f609d AccompanyingPeriodWork: add title on AccPeriodWorkEvaluationDocument 2022-02-24 16:11:29 +01:00
nobohan
0661eb8701 accompanyingCourseWork: add documents to vue form 2022-02-24 15:24:58 +01:00
nobohan
c073ec14c8 doc store bundle: add groups and correct denormalisation 2022-02-24 15:22:28 +01:00
nobohan
bf26092764 chilldocstore: add normalizer for StoredObject- correct typo 2022-02-24 14:56:16 +01:00
nobohan
e035a6fd94 chilldocstore: add normalizer for StoredObject 2022-02-24 14:54:56 +01:00
ff1ff8f5bb workflow: allow a user to get access to validation step by an access key 2022-02-24 12:17:13 +01:00
nobohan
3f43574371 docstore: use API entrypoint for storing storedObject in AddAsyncUpload.vue 2022-02-24 12:11:34 +01:00
nobohan
b1390f4e9b docstore: add swagger documentation 2022-02-24 11:20:11 +01:00
nobohan
fd29a4ce65 docstore: add api entrypoint POST for stored object 2022-02-24 11:18:11 +01:00
nobohan
4655892815 AddAsyncupload: translations and options 2022-02-24 10:04:06 +01:00
e46220ff72 [Household - list members during membership] avoid to show two membersship with the same person 2022-02-24 09:45:46 +01:00
nobohan
f19a090549 AddAsyncUpload.vue: add asyncupload form 2022-02-24 09:05:16 +01:00
08f9819453 add accessKey to entity workflow step 2022-02-23 18:33:29 +01:00
b56d8c2956 fix delete workflow 2022-02-23 17:53:18 +01:00
nobohan
5f71b46bb7 tentative to add asyncupload into modal 2022-02-23 17:21:35 +01:00
nobohan
154f976762 DocStore bundle: create a vue component for uploading document 2022-02-23 15:46:21 +01:00
d486f2ddfc fix styling of confidential toggle button in renderboxes 2022-02-23 10:46:25 +01:00
fc5ca30df0 Merge branch 'issue366_modal_thirdparty' of gitlab.com:Chill-Projet/chill-bundles into issue366_modal_thirdparty 2022-02-23 10:24:42 +01:00
0601fa0142 changelog updated 2022-02-23 10:24:24 +01:00
fffed6e3f6 Attempt to add on-the-fly for parent badge
Error: failed to resolve component on-the-fly
2022-02-23 10:24:01 +01:00
ffe4dd4a98 add delete feature for entityWorkflow (wip) 2022-02-23 10:08:11 +01:00
cc4dfdb042 style adjustment 2022-02-22 15:24:14 +01:00
fd0ca3b29d style adjustment + if contact display qualité 2022-02-22 15:18:38 +01:00
daab42109b style adjustment 2022-02-22 15:07:40 +01:00
ab5bb3963b Add qualité in personsuggestion 2022-02-22 15:06:31 +01:00
262bb13b6c Adding fonction in personrenderbox 2022-02-22 15:05:43 +01:00
5d530aaae9 Fix confidential toggle bug 2022-02-22 15:04:53 +01:00
nobohan
f0e6bfc6c6 update CHANGELOG 2022-02-22 12:57:16 +01:00
nobohan
d4283a0b94 social issue api controller: correct orderBy query 2022-02-22 12:53:47 +01:00
nobohan
568c4b60ef merge master into issue388 2022-02-22 12:47:56 +01:00
nobohan
736ca2272b fix unused imports 2022-02-22 12:44:40 +01:00
nobohan
88059884ec fix unused imports 2022-02-22 12:40:46 +01:00
nobohan
ce1d213082 [person] order social issues: remove custom controller and order only by 'ordering' 2022-02-22 12:36:04 +01:00
nobohan
71f3a3403c php code fix for Enfant Confie 2022-02-22 12:12:53 +01:00
nobohan
fbeda163f0 update CHANGELOG 2022-02-22 12:07:56 +01:00
nobohan
08c1bb7992 remove useless registerForAuyoconfiguration 2022-02-22 11:11:41 +01:00
nobohan
2f7b237c4c PersonJsonNormalizer interface: remove functions 2022-02-22 11:08:38 +01:00
nobohan
665027085d move DenormalizerAwareInterface and NormalizerAwareInterface from the interface to the class 2022-02-22 11:05:18 +01:00
nobohan
2618003177 personRenderBox: correct addition of suffixText 2022-02-22 10:48:14 +01:00
8f597eb254 update changelog 2022-02-21 17:40:09 +01:00
775d223be2 fix cs 2022-02-21 17:30:33 +01:00
3849776511 Merge remote-tracking branch 'origin/master' into kill_small_issues 2022-02-21 17:29:37 +01:00
cb3301bcef Merge remote-tracking branch 'origin/master' into thirdparty/redirect-to-parent-when-child-is-viewed 2022-02-21 17:27:20 +01:00
8d74566eac update changelog 2022-02-21 17:20:15 +01:00
4a03c2aa43 Merge remote-tracking branch 'origin/master' into issue447_pickCivilityType 2022-02-21 17:19:21 +01:00
292d56cfbe email added to person renderbox 2022-02-21 16:38:55 +01:00
b41e016a6d Merge branch 'issue366_modal_thirdparty' of gitlab.com:Chill-Projet/chill-bundles into issue366_modal_thirdparty 2022-02-21 16:38:35 +01:00
0a2e2301a9 document ThirdParty type and categories [ci-skip] 2022-02-21 15:25:46 +01:00
874c90e0e0 start to display profession/fonction of thirdparty 2022-02-21 14:30:30 +01:00
bb8898a4ec Merge branch 'course_add_event_on_person_move' into 'master'
Course add event on person move

See merge request Chill-Projet/chill-bundles!333
2022-02-21 12:29:43 +00:00
213da59b0b fix test failing due to microseconds difference 2022-02-21 13:22:35 +01:00
4e9879ba92 update changelog 2022-02-21 12:49:19 +01:00
0690704391 Merge remote-tracking branch 'origin/master' into course_add_event_on_person_move 2022-02-21 12:46:10 +01:00
610b861345 fix test on PersonAddressMoveEvent::personChangeAddress 2022-02-21 12:44:43 +01:00
b7f8ba4385 fix cs 2022-02-21 00:52:40 +01:00
a923a1f135 update changelog [ci-skip] 2022-02-21 00:41:50 +01:00
0d804dd817 3party: redirect to parent when child is opened in view mode 2022-02-21 00:39:02 +01:00
4f4b1bfbaa PersonAddressMove: fix tests, address history on household, and household::getMembersOnRange 2022-02-21 00:12:57 +01:00
caa63ea97a PersonAddressMoveEvent on household move (wip) 2022-02-19 14:04:51 +01:00
8675bb65c1 PersonMoveEventSubscriber: handle case when the move is before the last
locationHistory, but the move affects "now"
2022-02-19 10:27:44 +01:00
104af6d9b5 allow null value in end date in location history 2022-02-19 09:43:20 +01:00
2f2d4493ae Merge remote-tracking branch 'origin/master' into course_add_event_on_person_move 2022-02-19 09:31:00 +01:00
2d23068354 start to display profession/fonction of thirdparty 2022-02-18 17:07:53 +01:00
b65dacca72 bugfix onthefly thirdparty edit form
phonenumber was interchanged with telephone. Editing phonenumber was therefore not possible
2022-02-18 16:25:13 +01:00
265c8b776b bugfix in resourceItem
when address is null it gave an error and modal wouldn't close
2022-02-18 16:25:13 +01:00
4920c8b28b Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-02-18 15:59:54 +01:00
4f9acf3174 use correct translatorInterface instead of deprecated one 2022-02-18 15:59:36 +01:00
962957409b use correct translatorInterface instead of deprecated one 2022-02-18 15:51:52 +01:00
0b4d79fd5e display only last three actions in parcours resume 2022-02-18 15:51:00 +01:00
0efd3d2af3 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-02-18 14:46:55 +01:00
nobohan
02e5a1158d Create 3rd paerty contact: close modal after creation and check for errors 2022-02-18 14:44:19 +01:00
cfe32828a4 csfixes 2022-02-18 14:38:09 +01:00
nobohan
ca6bfea51f Create 3rd party contact: fix adding civility and profession to payload 2022-02-18 14:17:39 +01:00
nobohan
8c7da5f80c Merge branch 'master' into issue345_internal_thirdparty_contact 2022-02-18 11:22:51 +01:00
nobohan
57175e1c0b upd CHANGELOG 2022-02-18 09:18:09 +01:00
nobohan
c5d2953ecb php code fix for Residential Address 2022-02-18 09:15:13 +01:00
ee8044b857 Merge branch 'workflow/fix-sending-notifications' into 'master'
workflow: fix sending notifications

See merge request Chill-Projet/chill-bundles!347
2022-02-17 22:40:53 +00:00
1fda56b5f7 Merge remote-tracking branch 'origin/master' into workflow/fix-sending-notifications 2022-02-17 23:34:20 +01:00
ca79da2f9b Merge branch 'issue434_endDate_enfantHorsMenage' into 'master'
Add end date field for enfant hors menage

See merge request Chill-Projet/chill-bundles!341
2022-02-17 22:33:47 +00:00
c90e6231f9 Merge remote-tracking branch 'origin/master' into issue434_endDate_enfantHorsMenage 2022-02-17 23:31:14 +01:00
e86fa41180 Merge branch 'issue448_search_3rd_party' into 'master'
thirdparty search: add where clause for searching into children

See merge request Chill-Projet/chill-bundles!344
2022-02-17 22:28:25 +00:00
ebea4b7008 Merge remote-tracking branch 'origin/master' into issue434_endDate_enfantHorsMenage 2022-02-17 23:25:07 +01:00
9565464489 Merge branch 'homepage/add-workflow' into 'master'
add workflow on widget homepage

See merge request Chill-Projet/chill-bundles!343
2022-02-17 22:19:25 +00:00
05f83bf566 Merge remote-tracking branch 'origin/master' into issue448_search_3rd_party 2022-02-17 23:16:41 +01:00
673d0c1e53 Merge branch 'issue422_and_others_on_AddPersons' into 'master'
addPersons improvements

See merge request Chill-Projet/chill-bundles!340
2022-02-17 22:15:43 +00:00
fe35a29fb8 homepage vue / my workflow: replace "document" by object type 2022-02-17 23:12:14 +01:00
53d51fea2f Merge remote-tracking branch 'origin/master' into issue422_and_others_on_AddPersons 2022-02-17 22:51:52 +01:00
caaebd593b misc fixes for Thirdparty / addPerson
* set default values for ThirdParty in ThirdParty.vue
* set correct value for binding with phone (telephone instead of
phonenumber)
* add validation on ThirdParty/denomination: at least two characters, no
Null value
2022-02-17 22:42:52 +01:00
672fa48140 Merge branch 'issue415_filter_suggested_entities_by_close_participations' into 'master'
accompanying course: filter suggested entities by open participations

See merge request Chill-Projet/chill-bundles!339
2022-02-17 20:46:03 +00:00
a9aeea234c Merge remote-tracking branch 'origin/master' into issue415_filter_suggested_entities_by_close_participations 2022-02-17 21:45:43 +01:00
1683685f6b Merge branch 'issue465_display_person_resources' into 'master'
Display more info for person ressources

See merge request Chill-Projet/chill-bundles!338
2022-02-17 20:38:32 +00:00
e4aac56f2d Merge remote-tracking branch 'origin/master' into issue415_filter_suggested_entities_by_close_participations 2022-02-17 21:35:18 +01:00
d6990349d8 PersonResource: add link to person or 3party in the associated person or
3party part

There was a mismatch between "opening a resource to see the resource
details" and "see the associated person/3party details". On the previous location,
the user would expect to open the resource details, and not the person
details.
2022-02-17 21:28:27 +01:00
9ac2f7e359 Merge branch 'issue476_activity_fix_concerned_group' into 'master'
activity: can click through the cross icon for removing person in concerned group + fix duplicate display

See merge request Chill-Projet/chill-bundles!337
2022-02-17 20:22:04 +00:00
f86c0353a2 Merge remote-tracking branch 'origin/master' into issue465_display_person_resources 2022-02-17 21:17:40 +01:00
0a289e1edd Merge remote-tracking branch 'origin/master' into issue476_activity_fix_concerned_group 2022-02-17 21:11:45 +01:00
c2c5bec0e5 in period notification, handle case when period referrer is null 2022-02-17 21:08:55 +01:00
68bfca8a1f Merge remote-tracking branch 'origin/master' into issue442_toggle_emergency 2022-02-17 20:04:45 +01:00
nobohan
6e1b95aa60 residential address: show residential address or info in PersonRenderBox + add ThirdPartyText 2022-02-17 18:05:34 +01:00
nobohan
baf9b6e1ae residential address: correct normalization 2022-02-17 18:04:50 +01:00
nobohan
c302f2dcf9 PersonRenderBox: add residential address 2022-02-17 16:29:51 +01:00
nobohan
24fc7a216b person: add current residential address in normalizer 2022-02-17 15:42:37 +01:00
nobohan
2926965400 move residentialAddress entity to the ChillPerson bundle 2022-02-17 15:08:12 +01:00
nobohan
341177aa5e fix conflict in CHANGELOG 2022-02-17 14:22:55 +01:00
56923aa1b8 use statement added to fix CI 2022-02-17 10:04:56 +01:00
62f54a3c27 changelog updated 2022-02-17 09:57:39 +01:00
64e9461586 'ressources' changed to 'personnes ressources' plus order in menu changed 2022-02-17 09:57:29 +01:00
5e01eebd25 'gabarit' changed to 'modèle' 2022-02-17 09:57:02 +01:00
bae2a385aa notification word 'one' changed to number 2022-02-17 09:56:41 +01:00
9861e3fe1c csfixes 2022-02-17 09:43:49 +01:00
95b2fcead7 update changelog [ci-skip] 2022-02-16 21:58:49 +01:00
45beb27f83 fix sending notifications 2022-02-16 21:54:37 +01:00
nobohan
b992bde41d Created an interface for PersonJsonNormalizer 2022-02-16 21:09:27 +01:00
20104f1b3b implementation in thirdpartyType 2022-02-16 16:58:37 +01:00
25264447bc csfixes 2022-02-16 16:56:02 +01:00
c1036a3627 fix getParent() 2022-02-16 16:54:55 +01:00
f1a9a872bb creation of CivilityPicker and attempt to implement -> still error 2022-02-16 16:38:53 +01:00
df322d7ebb creation of CivilityPicker and attempt to implement -> still error 2022-02-16 16:37:13 +01:00
nobohan
56a4fd3fa0 Person: add suffixText in PersonText.vue 2022-02-16 16:20:08 +01:00
nobohan
02716a6a93 PersonRender: adapt twig template to suffixText 2022-02-16 15:55:26 +01:00
d4534b56a0 bugfix listing mes parcours for user 2022-02-16 15:28:08 +01:00
nobohan
81b7b49170 ChillEntityRenderExtension: change the way the service in constructed by using tags 2022-02-16 15:23:32 +01:00
c8922a6a82 minor correction 2022-02-16 14:26:00 +01:00
cdf0bb30c9 display of correct message for 403 error fixed + translation 2022-02-16 14:25:34 +01:00
e4793e1a77 minor fixes 2022-02-16 13:52:20 +01:00
8347ddd5be bugfix if there is no address edit of resourceItem was not possible 2022-02-16 13:51:51 +01:00
12412e05a7 removal double entry 2022-02-16 13:33:45 +01:00
nobohan
dd99c35e35 upd CHANGELOG 2022-02-16 11:24:30 +01:00
nobohan
9d651a70e9 merge last AddPerson branch 2022-02-16 11:23:21 +01:00
b0d50d315c Merge conflict in changelog fixed 2022-02-16 10:56:44 +01:00
41bddf2db6 return interchange of name and text back to how it was before -> solves one bug recreates the other 2022-02-16 10:55:44 +01:00
769700fe83 comment removed 2022-02-16 10:55:44 +01:00
433ccb1fc4 bugfix of double civility abbreviation after edit 2022-02-16 10:55:44 +01:00
145c1d59e9 bugfix emit saveFormOnTheFly and add newly created contact to suggestion list immediately 2022-02-16 10:55:44 +01:00
ae8cc0f700 attempt to not include parent address 2022-02-16 10:55:24 +01:00
a764da3e99 changelog updated 2022-02-16 10:55:05 +01:00
8f92f79f85 placeholders for civility and profession 2022-02-16 10:55:05 +01:00
f093765d03 correction for POST phonenumber and email 2022-02-16 10:55:05 +01:00
c44d962ba8 only show addcontact button for personne morale 2022-02-16 10:55:05 +01:00
20d22b726c possible to add a contact to a thirdparty 2022-02-16 10:55:05 +01:00
8fa2f0e7ad small corrections 2022-02-16 10:54:42 +01:00
604c7f385e further attempts to do POST of thirdparty contact, passing parent id causes problems + civility and profession fk's are not saved on POST 2022-02-16 10:54:42 +01:00
1a07c9d71a v-model added so data is taken from the form for all fields + modal title correction 2022-02-16 10:54:20 +01:00
f7e287d415 onTheFly modal to add contact to thirdparty - form fields for profession,civility, and comment added - no saving possible yet 2022-02-16 10:54:04 +01:00
b16cc2dc27 translations added 2022-02-16 10:53:34 +01:00
188447fc10 use correct button 2022-02-16 10:48:23 +01:00
b920bf6d22 parent id added to thirdparty data 2022-02-16 10:47:59 +01:00
32ff54e130 v-model added so data is taken from the form for all fields + modal title correction 2022-02-16 10:47:59 +01:00
02c09687a4 onTheFly modal to add contact to thirdparty - form fields for profession,civility, and comment added - no saving possible yet 2022-02-16 10:47:13 +01:00
3b1fc4aacb translations added 2022-02-16 10:46:57 +01:00
bf9469d538 endpoints created for profession and civility for use in vue component 2022-02-16 10:46:35 +01:00
c2dec360b1 unsaved changes 2022-02-16 10:46:06 +01:00
dc7422bf56 unsaved changes 2022-02-16 10:46:06 +01:00
89edf508f5 button added to add contact to personne morale (styling not correct yet) + opening of onTheFly thirdparty, but conditions and parameters not yet correct 2022-02-16 10:46:06 +01:00
nobohan
50410d190f replace PersonRender by PersonRenderInterface 2022-02-16 10:38:58 +01:00
nobohan
b54e076ca0 PersonRenderInterface: remove methods 2022-02-16 10:27:34 +01:00
2ab7556ac3 Add workflows tab to dashboard 2022-02-16 10:26:00 +01:00
3d38da7b37 Add workflow notifications to the dashboard 2022-02-16 10:25:18 +01:00
056d5a3f98 Remove counter from 'mes parcours' 2022-02-16 10:24:05 +01:00
17612afd87 fix phpstan issues 2022-02-16 00:08:06 +01:00
0a4913f341 handle event PersonMoveEvent on Period 2022-02-15 23:52:15 +01:00
nobohan
3aa12d2e8c [person] Add a PersonRenderInterface 2022-02-15 17:48:54 +01:00
a6504366b4 Fix to display message in toast when user is forbidden to do something
Translation does not work
2022-02-15 14:34:40 +01:00
4e83e7905a Validation of confidential toggle added to accompanyingPeriod validator 2022-02-15 14:22:41 +01:00
nobohan
96b1854fef php code style fix 2022-02-15 13:57:02 +01:00
nobohan
489473806f upd CHANGELOG 2022-02-15 13:41:59 +01:00
nobohan
f5bc8dca5e thirdparty search: adapt pertinence select clause for searching into children 2022-02-15 13:39:46 +01:00
nobohan
bc99c85802 thirdparty search: add where clause for searching into children 2022-02-15 13:16:04 +01:00
385664e2bc fix merge conflict 2022-02-15 10:01:01 +01:00
1658fee090 test on members editor post move + listen for event (wip) 2022-02-15 00:23:01 +01:00
b9dbb1916a migration for history, and create history location on each change 2022-02-14 23:03:40 +01:00
nobohan
99afd2e830 OnTheFly: set a dynamic default 2022-02-14 22:03:11 +01:00
861f461bc5 workflow context for accompanying course document: ensure persons are represented as an array in json 2022-02-14 20:19:56 +01:00
b6c118a0c8 add informations to workflow normalization 2022-02-14 20:02:24 +01:00
89d3ab38f0 add endpoint to list workflows 2022-02-14 20:02:07 +01:00
441704dc29 first impl of event (WIP) 2022-02-14 18:29:11 +01:00
8ee451c6e0 fixes 2022-02-14 18:00:09 +01:00
nobohan
785e690404 On-the-fly: remove dead code: the logic of patching a person/thirdparty is now in the component in 2022-02-14 16:48:33 +01:00
nobohan
2fcd7a21a4 Accompanying course: can edit requestor in case no address 2022-02-14 16:47:35 +01:00
nobohan
d5c1591205 Accompanying course: remove unnecessary console.log 2022-02-14 16:15:38 +01:00
nobohan
7895699ef3 stronger client-side validation of addresses: also validate when initForm 2022-02-14 15:47:21 +01:00
nobohan
bd9963e65f Address: fix small bug: when modifying an address without street (isNoAddress), also check errors if street is an empty string as back-end change null value to empty string for street (and streetNumber) 2022-02-14 15:00:57 +01:00
df61fbff12 merge conflicts resolved 2022-02-14 14:55:47 +01:00
844650b685 fix sending notification when unsetting a referrer from a period
When the user removes the referrer, a notification was send to a `null`
addressee, which causes an unhandled exception.
2022-02-14 14:22:33 +01:00
nobohan
a7a1f699bb AddPersons: fix regression bug when editing a person/thirdparty without query 2022-02-14 14:13:06 +01:00
nobohan
229a91ddf0 Accompanying course: treat vuejs warning by refactoring + delete unused v-model 2022-02-14 13:59:49 +01:00
68d0c66402 fix cs 2022-02-14 13:48:47 +01:00
c2a132a40b Merge remote-tracking branch 'origin/master' into issue442_toggle_emergency 2022-02-14 13:40:23 +01:00
nobohan
94729a66ca AddPersons: add suggestion of name when creating new person or thirdparty 2022-02-14 12:22:02 +01:00
bd05315de3 csfixes 2022-02-14 12:02:32 +01:00
d254a9e14a add endDate field in HouseholdMember form for enfant hors menage 2022-02-14 12:02:15 +01:00
nobohan
1c3f6c7c1e AddPersons: allow creation of person or thirdparty depending on allowed types 2022-02-14 11:12:37 +01:00
nobohan
f8888462f1 addPersons: allow creation of person or thirdparty only (no users) 2022-02-14 10:23:49 +01:00
nobohan
4e2be091cd Merge branch 'issue415_filter_suggested_entities_by_close_participations' of gitlab.com:Chill-Projet/chill-bundles into issue415_filter_suggested_entities_by_close_participations 2022-02-11 17:41:50 +01:00
nobohan
40a1726ca7 upd CHANGELOG 2022-02-11 17:41:39 +01:00
nobohan
fc9deb8ba8 accompanying course: filter suggested entities by open participations 2022-02-11 17:41:12 +01:00
nobohan
b1993dbf22 accompanying course: filter suggested entities by open participations 2022-02-11 17:37:45 +01:00
973644c62d csfixes 2022-02-11 17:07:47 +01:00
b9af54892b changelog updated 2022-02-11 17:04:15 +01:00
f9154233e4 using renderbox and adjusting style + show button if person or thirdparty 2022-02-11 17:02:31 +01:00
nobohan
aa7da2559c [activity] correct associated persons by considering only open participations 2022-02-11 16:48:15 +01:00
753a007172 translation added for kind of resource 2022-02-11 16:32:28 +01:00
nobohan
01a3af694a activity: can click through the cross icon for removing person in concerned group 2022-02-11 15:49:49 +01:00
50b7df1f4a adding thirdparty info 2022-02-11 15:16:28 +01:00
bb93cb23a7 fix handling of address 2022-02-11 12:09:42 +01:00
57a88845dc Merge remote-tracking branch 'origin/master' into issue388_order_social_issues 2022-02-11 10:54:37 +01:00
3532e9dd8c changelog updated 2022-02-09 18:22:28 +01:00
fddb74f107 toggleConfidential reset to what it was before 2022-02-09 18:05:55 +01:00
ee817b1d62 url's and method changed for toggleIntensity and toggleConfidential 2022-02-09 17:56:53 +01:00
a399804094 Endpoint created + swagger documentation + controller action 2022-02-09 17:38:35 +01:00
05e9f118d7 Corrections voter + entity property intensity, not emergency 2022-02-09 17:18:45 +01:00
7aad5be29f Toggle_emergency variable added to voter 2022-02-09 17:08:29 +01:00
41b0dd50bd emergency property write permission removed from entity 2022-02-09 17:07:58 +01:00
4de2cbe807 return interchange of name and text back to how it was before -> solves one bug recreates the other 2022-02-09 09:53:15 +01:00
bc2d4c1066 Merge remote-tracking branch 'origin/issue433_email_addPerson' into issue345_internal_thirdparty_contact 2022-02-04 11:09:51 +01:00
298b597dd0 comment removed 2022-02-04 10:50:59 +01:00
481456a038 Merge conflicts fixed 2022-02-04 10:25:46 +01:00
nobohan
2c94811c8f person: social issue api controller: add onPostIndexBuildQuery 2022-02-01 17:01:19 +01:00
nobohan
eb32b13bcc person: rewrite social issue api controller for ordering 2022-02-01 16:49:14 +01:00
b87f14255d bugfix of double civility abbreviation after edit 2022-01-24 14:44:53 +01:00
0f2cbbe553 bugfix emit saveFormOnTheFly and add newly created contact to suggestion list immediately 2022-01-24 14:24:56 +01:00
256c5688a0 attempt to not include parent address 2022-01-19 16:51:21 +01:00
6460007aa1 changelog updated 2022-01-19 12:18:09 +01:00
f84e088e7b placeholders for civility and profession 2022-01-19 12:14:37 +01:00
b8e16d2929 correction for POST phonenumber and email 2022-01-19 11:06:07 +01:00
88fc5e94fa only show addcontact button for personne morale 2022-01-19 11:00:53 +01:00
4431428c26 possible to add a contact to a thirdparty 2022-01-19 10:57:31 +01:00
724ce8c9af small corrections 2022-01-19 09:57:19 +01:00
a31b74e0e5 further attempts to do POST of thirdparty contact, passing parent id causes problems + civility and profession fk's are not saved on POST 2022-01-17 12:00:22 +01:00
47615e2e5d merge conflicts fixed 2022-01-14 16:13:35 +01:00
475585c5e7 use correct button 2022-01-14 09:30:00 +01:00
a2e086be75 add a chill button "tpchild", to create on-the-fly thirdparty (kind=child) 2022-01-14 09:30:00 +01:00
e6cf1994b0 parent id added to thirdparty data 2022-01-14 09:30:00 +01:00
bea0b69858 v-model added so data is taken from the form for all fields + modal title correction 2022-01-14 09:30:00 +01:00
95547e961e onTheFly modal to add contact to thirdparty - form fields for profession,civility, and comment added - no saving possible yet 2022-01-14 09:28:19 +01:00
c4a859f2d2 translations added 2022-01-14 09:27:36 +01:00
a39bd79930 endpoints created for profession and civility for use in vue component 2022-01-14 09:27:06 +01:00
424d0533b8 unsaved changes 2022-01-14 09:27:06 +01:00
5a7d187a10 unsaved changes 2022-01-14 09:27:06 +01:00
dc8dd6a423 button added to add contact to personne morale (styling not correct yet) + opening of onTheFly thirdparty, but conditions and parameters not yet correct 2022-01-14 09:27:06 +01:00
006e8cdc27 minor bug fix for view page of thirdparty property 'types' -> 'thirdPartyTypes' 2022-01-14 09:27:06 +01:00
cf4f6f06e9 use correct button 2022-01-13 17:58:30 +01:00
e467820345 add a chill button "tpchild", to create on-the-fly thirdparty (kind=child) 2022-01-13 17:53:32 +01:00
416a1c4e4d parent id added to thirdparty data 2022-01-13 16:36:54 +01:00
1febfc11e5 v-model added so data is taken from the form for all fields + modal title correction 2022-01-13 16:30:52 +01:00
a288fdf12d resolve merge conflict 2022-01-13 14:40:37 +01:00
6a3f17962b onTheFly modal to add contact to thirdparty - form fields for profession,civility, and comment added - no saving possible yet 2022-01-13 14:35:53 +01:00
3860adc435 translations added 2022-01-13 14:34:28 +01:00
65daf2d0cf endpoints created for profession and civility for use in vue component 2022-01-13 14:33:57 +01:00
9bf41bbd34 unsaved changes 2022-01-12 17:41:58 +01:00
de7de22492 unsaved changes 2022-01-12 17:40:36 +01:00
ea66fb4c37 button added to add contact to personne morale (styling not correct yet) + opening of onTheFly thirdparty, but conditions and parameters not yet correct 2022-01-12 17:38:24 +01:00
c1232037a9 minor bug fix for view page of thirdparty property 'types' -> 'thirdPartyTypes' 2022-01-12 13:52:26 +01:00
75eb6414ce test set back to what it was otherwise error 2021-12-02 15:38:27 +01:00
5e7445a4fe stylefix 2021-12-02 15:31:38 +01:00
c527b1b3cf validation attempt with assert\callback: still doesn't work 2021-12-02 15:31:08 +01:00
acacef936c changelog updated and stylefix 2021-12-02 12:49:33 +01:00
f971dc05eb test written, but the validation expression is not yet correct 2021-12-02 12:33:10 +01:00
9aba4ea8f6 first commit 2021-11-29 14:06:22 +01:00
283 changed files with 7012 additions and 2157 deletions

View File

@@ -29,6 +29,7 @@ variables:
REDIS_URL: redis://redis:6379
# change vendor dir to make the app install into tests/apps
COMPOSER_VENDOR_DIR: tests/app/vendor
DEFAULT_CARRIER_CODE: BE
stages:
- Composer install
@@ -78,6 +79,7 @@ psalm_tests:
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
script:
- bin/grumphp run --tasks=psalm
allow_failure: true
artifacts:
expire_in: 30 min
paths:

View File

@@ -11,9 +11,60 @@ and this project adheres to
## Unreleased
<!-- write down unreleased development here -->
* [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472)
* [person] Add url in accompanying period work evaluations entity and form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/476)
* [person] Add document generation in admin and in person/{id}/document (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/464)
* [activity] do not override location if already exist (when validating new activity) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/470)
* [parcours] Toggle emergency/intensity only by referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442)
* [docstore] Add an API entrypoint for StoredObject (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
* [person] Add the possibility of uploading existing documents to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
* [person] Add title to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
* [person] Order social issues by the field "ordering" (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/388)
* [Person/Household list] when listing other simultaneous members of an household, exclude the members on person, not on members (avoid to show two membersship with the same person)
* [draft periods] add a delete button (if acl granted) on each draft period listed on draft period page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/463)
* [Person] Display suffixText in RenderPerson, PersonText.vue, RenderPersonBox.vue (was made for displaying "enfant confie") (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/441)
* [person] residential address: show residential address or info in PersonRenderBox, refactor Residential Address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/439)
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
* [documents] Improve flex-table item-col placement when long buttons and long metadata
* [thirdparty] Fix display of multiple contact badges so they wrap onto next line (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/482)
* [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue)
* [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474)
* [template] do not list inactive templates (for doc generator)
* [parcours] location cannot be removed if linked to a user (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/478)
* [person] email added to twig personRenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/490)
* [person] Add link to current household in person banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/484)
## Test releases
### test release 2022-02-21
* [notifications] Word 'un' changed to number '1' for notifications in user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/483)
* [documents] 'gabarit' changed to 'modèle' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/405)
* [person_resources] Menu name and order changed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/460)
* workflow: fix sending notifications
* [thirdparty] Extend the thirdparty search to thirdparty children (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/448)
* [person]: AddPersons: allow creation of person or thirdparty only (no users) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
* [person]: AddPersons: allow creation of person or thirdparty depending on allowed types (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
* [person]: AddPersons: add suggestion of name when creating new person or thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
* [main] Address: fix small bug: when modifying an address without street (isNoAddress), also check errors if street is an empty string as back-end change null value to empty string for street (and streetNumber)
* [main] Address: stronger client-side validation of addresses (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/449)
* [person] accompanying course: filter suggested entities by open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/415)
[activity] can click through the cross icon for removing person in concerned group (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476)
[activity] correct associated persons by considering only open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476)
* [person_resources]: Renderboxes used to display person/thirdparty info (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/465)
* [Household]: Add end date in HouseholdMember form for 'enfant hors menage' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/434)
* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435)
* [parcours]: Order social activities and only display most recent three in parcours resumé (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/481)
* [3party]: 3party: redirect to parent when contact (child) is opened in view page
* [parcours / addresses]: launch an event when a person change address (either through changing household or because the household is associated to a new address). If the person is localising a course, the course location go back to a temporarily address.
* [thirdparty]: address/phonenumber/email/fonction displayed in thirdpartyrenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/401)
* [thirdparty_contact]: in search results the 'qualité' is displayed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/465)
* [bug]: fix confidential toggle of address in thirdpartyrenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/460)
## Test releases
* Creation of PickCivilityType, and implementation in PersonType and ThirdpartyType
### test release 2022-02-14
* AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419)
@@ -22,13 +73,14 @@ and this project adheres to
* [person] accompanying course work: fix on-the-fly update of thirdParty
* fix normalisation of accompanying course requestor api (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/378)
* [person] add a returnPath when clicking on some Person or ThirdParty badge (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/427)
* [person] accompanying course work: fix on-the-fly update of thirdParty
* [person] accompanying course work: fix on-the-fly update of thirdParty
* [on-the-fly] close modal only after validation
* [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433)
* change order for accompanying course work list
* [parcours]: Mes parcours brouillon added to user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/440)
* [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414)
* [person]: style fix in parcours listing per person. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/432)
* [parcours]: Only the referrer can toggle the intensity of the parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442)
* [household]: display address of current household (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/415)
* ajoute un ordre dans les localisation (api)
* [pick entity]: fix translations in modal (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/419)
@@ -38,7 +90,7 @@ and this project adheres to
* [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459)
* [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414)
* [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450)
* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435)
### test release 2021-02-01
@@ -59,7 +111,19 @@ and this project adheres to
* [AddAddress] disable multiselect search, and rely only on most pertinent Cities and Street computed backend
* [fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
## Test releases
=======
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
>>>>>>> issue422_and_others_on_AddPersons
=======
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
>>>>>>> b0d50d315c8e00959a967badac9cf5057ab2b4bc
### test release 2021-01-31
* [person] accompanying course: optimisation: do not fetch some resources for the banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/409)
@@ -265,6 +329,7 @@ and this project adheres to
* add an endpoint for checking permissions. See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/232
* [activity] for a new activity: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
* [calendar] for a new rdv: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
* [period] Validation added when period is confidential and confirmed -> user cannot be null.
## Test releases

BIN
composer Executable file

Binary file not shown.

View File

@@ -22,6 +22,7 @@
"league/csv": "^9.7.1",
"nyholm/psr7": "^1.4",
"ocramius/package-versions": "^1.10",
"odolbeau/phone-number-bundle": "^3.6",
"phpoffice/phpspreadsheet": "^1.16",
"ramsey/uuid-doctrine": "^1.7",
"sensio/framework-extra-bundle": "^5.5",

View File

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

View File

@@ -295,11 +295,6 @@ parameters:
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: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
@@ -325,11 +320,6 @@ parameters:
count: 1
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1

View File

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

View File

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

View File

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

View File

@@ -110,10 +110,8 @@ export default function prepareLocations(store) {
console.log('default loation id', window.default_location_id);
if (window.default_location_id) {
for (let group of store.state.availableLocations) {
console.log(group);
let location = group.locations.find((l) => l.id === window.default_location_id);
console.log(location);
if (location !== undefined) {
if (location !== undefined & store.state.activity.location === null) {
store.dispatch('updateLocation', location);
break;
}

View File

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

View File

@@ -76,7 +76,7 @@ activity:
Insert a document: Insérer un document
Remove a document: Supprimer le document
comment: Commentaire
No documents: Pas de documents
No documents: Aucun document
#timeline
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'

View File

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

View File

@@ -207,21 +207,21 @@ final class DocGeneratorTemplateController extends AbstractController
$context instanceof DocGeneratorContextWithPublicFormInterface
&& $context->hasPublicForm($template, $entity) || $isTest
) {
if ($context instanceof DocGeneratorContextWithPublicFormInterface) {
if ($context instanceof DocGeneratorContextWithPublicFormInterface && $context->hasPublicForm($template, $entity)) {
$builder = $this->createFormBuilder(
array_merge(
$context->getFormData($template, $entity),
$isTest ? ['test_file' => null] : []
)
);
$context->buildPublicForm($builder, $template, $entity);
} else {
$builder = $this->createFormBuilder(
['test_file' => null]
);
}
$context->buildPublicForm($builder, $template, $entity);
if ($isTest) {
$builder->add('test_file', FileType::class, [
'label' => 'Template file',

View File

@@ -70,6 +70,7 @@ final class DocGeneratorTemplateRepository implements ObjectRepository
$builder
->where('t.entity LIKE :entity')
->andWhere($builder->expr()->eq('t.active', "'TRUE'"))
->setParameter('entity', addslashes($entity));
return $builder

View File

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

View File

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

View File

@@ -21,6 +21,8 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use DateTime;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@@ -59,21 +61,37 @@ class DocumentAccompanyingCourseController extends AbstractController
}
/**
* @Route("/{id}", name="accompanying_course_document_delete", methods="DELETE")
* @Route("/{id}/delete", name="chill_docstore_accompanying_course_document_delete")
*/
public function delete(Request $request, AccompanyingPeriod $course, AccompanyingCourseDocument $document): Response
{
$this->denyAccessUnlessGranted(AccompanyingCourseDocumentVoter::DELETE, $document);
if ($this->isCsrfTokenValid('delete' . $document->getId(), $request->request->get('_token'))) {
$em = $this->getDoctrine()->getManager();
$em->remove($document);
$em->flush();
$form = $this->createForm(FormType::class);
$form->add('submit', SubmitType::class, ['label' => 'Delete']);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->getDoctrine()->getManager()->remove($document);
$this->getDoctrine()->getManager()->flush();
$this->addFlash('success', $this->translator->trans('The document is successfully removed'));
if ($request->query->has('returnPath')) {
return $this->redirect($request->query->get('returnPath'));
}
return $this->redirectToRoute('accompanying_course_document_index', ['course' => $course->getId()]);
}
return $this->redirectToRoute(
'accompanying_course_document_index',
['accompanyingCourse' => $course->getId()]
return $this->render(
'ChillDocStoreBundle:AccompanyingCourseDocument:delete.html.twig',
[
'document' => $document,
'delete_form' => $form->createView(),
'accompanyingCourse' => $course,
]
);
}

View File

@@ -14,6 +14,7 @@ namespace Chill\DocStoreBundle\Controller;
use Chill\DocStoreBundle\Entity\PersonDocument;
use Chill\DocStoreBundle\Form\PersonDocumentType;
use Chill\DocStoreBundle\Repository\PersonDocumentACLAwareRepositoryInterface;
use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter;
use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\PersonBundle\Entity\Person;
@@ -22,6 +23,8 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
use DateTime;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@@ -64,22 +67,37 @@ class DocumentPersonController extends AbstractController
}
/**
* @Route("/{id}", name="person_document_delete", methods="DELETE")
* @Route("/{id}/delete", name="chill_docstore_person_document_delete")
*/
public function delete(Request $request, Person $person, PersonDocument $document): Response
{
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
$this->denyAccessUnlessGranted('CHILL_PERSON_DOCUMENT_DELETE', $document);
$this->denyAccessUnlessGranted(PersonDocumentVoter::DELETE, $document);
if ($this->isCsrfTokenValid('delete' . $document->getId(), $request->request->get('_token'))) {
$em = $this->getDoctrine()->getManager();
$em->remove($document);
$em->flush();
$form = $this->createForm(FormType::class);
$form->add('submit', SubmitType::class, ['label' => 'Delete']);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->getDoctrine()->getManager()->remove($document);
$this->getDoctrine()->getManager()->flush();
$this->addFlash('success', $this->translator->trans('The document is successfully removed'));
if ($request->query->has('returnPath')) {
return $this->redirect($request->query->get('returnPath'));
}
return $this->redirectToRoute('person_document_index', ['person' => $person->getId()]);
}
return $this->redirectToRoute(
'person_document_index',
['person' => $person->getId()]
return $this->render(
'ChillDocStoreBundle:PersonDocument:delete.html.twig',
[
'document' => $document,
'delete_form' => $form->createView(),
'person' => $person,
]
);
}
@@ -98,7 +116,6 @@ class DocumentPersonController extends AbstractController
PersonDocumentType::class,
$document,
[
'center' => $document->getCenter(),
'role' => 'CHILL_PERSON_DOCUMENT_UPDATE',
]
);
@@ -199,7 +216,6 @@ class DocumentPersonController extends AbstractController
$document->setDate(new DateTime('Now'));
$form = $this->createForm(PersonDocumentType::class, $document, [
'center' => $document->getCenter(),
'role' => 'CHILL_PERSON_DOCUMENT_CREATE',
]);
$form->handleRequest($request);

View File

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

View File

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

View File

@@ -13,15 +13,13 @@ namespace Chill\DocStoreBundle\Form;
use Chill\DocStoreBundle\Entity\Document;
use Chill\DocStoreBundle\Entity\PersonDocument;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Chill\MainBundle\Form\Type\ScopePickerType;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectManager;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\AbstractType;
@@ -31,34 +29,16 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PersonDocumentType extends AbstractType
{
/**
* @var AuthorizationHelper
*/
protected $authorizationHelper;
/**
* @var ObjectManager
*/
protected $om;
/**
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
* the user running this form.
*
* @var User
*/
protected $user;
private CenterResolverDispatcher $centerResolverDispatcher;
private ParameterBagInterface $parameterBag;
private ScopeResolverDispatcher $scopeResolverDispatcher;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
TranslatableStringHelper $translatableStringHelper,
TranslatableStringHelperInterface $translatableStringHelper,
ScopeResolverDispatcher $scopeResolverDispatcher,
ParameterBagInterface $parameterBag
) {
@@ -96,7 +76,7 @@ class PersonDocumentType extends AbstractType
if ($isScopeConcerned && $this->parameterBag->get('chill_main')['acl']['form_show_scopes']) {
$builder->add('scope', ScopePickerType::class, [
'center' => $options['center'],
'center' => $this->centerResolverDispatcher->resolveCenter($document),
'role' => $options['role'],
]);
}
@@ -108,8 +88,7 @@ class PersonDocumentType extends AbstractType
'data_class' => Document::class,
]);
$resolver->setRequired(['role', 'center'])
->setAllowedTypes('role', ['string'])
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class]);
$resolver->setRequired(['role'])
->setAllowedTypes('role', ['string']);
}
}

View File

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

View File

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

View File

@@ -1,5 +0,0 @@
<form method="post" action="{{ path('accompanying_course_document_delete', {'id': document.id, 'course': course.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ document.id) }}">
<button class="btn btn-delete">{{ 'Delete' | trans }}</button>
</form>

View File

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

View File

@@ -0,0 +1,43 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = '' %}
{% block title %}{{ 'Delete document ?' }}{% endblock %}
{% block docdescription %}
<dl class="chill_view_data">
<dt>{{ 'Title'|trans }}</dt>
<dd>{{ document.title }}</dd>
{% if document.scope is not null %}
<dt>{{ 'Scope' | trans }}</dt>
<dd>{{ document.scope.name | localize_translatable_string }}</dd>
{% endif %}
<dt>{{ 'Category'|trans }}</dt>
<dd>{{ document.category.name|localize_translatable_string }}</dd>
<dt>{{ 'Description' | trans }}</dt>
<dd>
{% if document.description is empty %}
<span class="chill-no-data-statement">{{ 'Any description'|trans }}</span>
{% else %}
<blockquote class="chill-user-quote">
{{ document.description|chill_markdown_to_html }}
</blockquote>
{% endif %}
</dd>
</dl>
{% endblock %}
{% block content %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Delete document ?'|trans,
'display_content' : block('docdescription'),
'confirm_question' : 'Are you sure you want to remove this document ?'|trans,
'cancel_route' : 'accompanying_course_document_index',
'cancel_parameters' : {'course' : accompanyingCourse.id, 'id': document.id},
'form' : delete_form
} ) }}
{% endblock %}

View File

@@ -25,8 +25,13 @@
{{ 'Back to the list' | trans }}
</a>
</li>
<li class="edit">
<button class="btn btn-edit">{{ 'Edit'|trans }}</button>
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE', document) %}
<li class="delete">
<a href="{{ chill_return_path_or('chill_docstore_accompanying_course_document_delete', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-delete"></a>
</li>
{% endif %}
<li class="edit">
<button class="btn btn-edit">{{ 'Edit'|trans }}</button>
</li>
</ul>

View File

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

View File

@@ -49,12 +49,9 @@
{{ 'Back to the list' | trans }}
</a>
</li>
<li>
{{ m.download_button(document.object, document.title) }}
</li>
{% if chill_document_is_editable(document.object) %}
<li>
{{ document.object|chill_document_edit_button }}
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE', document) %}
<li class="delete">
<a href="{{ chill_return_path_or('chill_docstore_accompanying_course_document_delete', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-delete"></a>
</li>
{% endif %}
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
@@ -63,6 +60,14 @@
class="btn btn-edit" title="{{ 'Edit attributes' | trans }}"></a>
</li>
{% endif %}
<li>
{{ m.download_button(document.object, document.title) }}
</li>
{% if chill_document_is_editable(document.object) %}
<li>
{{ document.object|chill_document_edit_button }}
</li>
{% endif %}
{% set workflows_frame = chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) %}
{% if workflows_frame is not empty %}
<li>

View File

@@ -1,8 +1,10 @@
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %}
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
<div class="item-col" style="width: unset">
<div class="denomination h2">
{{ document.title }}
</div>
@@ -22,62 +24,68 @@
<div class="item-col">
<div class="container">
{% if document.date is not null %}
<div class="dates row" style="float: right;">
<span>{{ document.createdAt|format_date('short') }}</span>
<div class="dates row text-end">
<span>{{ document.date|format_date('short') }}</span>
</div>
{% endif %}
</div>
</div>
</div>
{% if document.description is not empty %}
<div class="item-row separator">
<blockquote class="chill-user-quote">
<div class="item-row">
<blockquote class="chill-user-quote col">
{{ document.description|chill_markdown_to_html }}
</blockquote>
</div>
{% endif %}
<div class="item-row separator">
<div class="item-col item-meta">
<div class="updatedBy">
{{ 'Created by'|trans }}:
<span class="user">{{ document.createdBy|chill_entity_render_string }}</span>
<span class="date">le {{ document.createdAt|format_date('long') }}</span>
</div>
{{ mmm.createdBy(document) }}
</div>
</div>
<div>
{% if document.course is defined %}
<ul class="record_actions">
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
<ul class="item-col record_actions flex-shrink-1">
{% if document.course is defined %}
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE', document) %}
<li class="delete">
<a href="{{ chill_return_path_or('chill_docstore_accompanying_course_document_delete', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-delete"></a>
</li>
{% endif %}
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
<li>
<a href="{{ path('accompanying_course_document_edit', {'course': accompanyingCourse.id, 'id': document.id }) }}" class="btn btn-update"></a>
</li>
{% endif %}
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
<li>
{{ m.download_button(document.object, document.title) }}
</li>
<li>
<a href="{{ chill_path_add_return_path('accompanying_course_document_show', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-show"></a>
</li>
{% endif %}
<li>
{{ m.download_button(document.object, document.title) }}
</li>
<li>
<a href="{{ chill_path_add_return_path('accompanying_course_document_show', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-show"></a>
</li>
{% endif %}
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
<li>
<a href="{{ path('accompanying_course_document_edit', {'course': accompanyingCourse.id, 'id': document.id }) }}" class="btn btn-update"></a>
{{ chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) }}
</li>
{% else %}
{% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
<li class="delete">
<a href="{{ chill_return_path_or('chill_docstore_person_document_delete', {'person': person.id, 'id': document.id}) }}" class="btn btn-delete"></a>
</li>
{% endif %}
{% if is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document) %}
<li>
<a href="{{ path('person_document_edit', {'person': person.id, 'id': document.id}) }}" class="btn btn-update"></a>
</li>
{% endif %}
{% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %}
<li>
{{ m.download_button(document.object, document.title) }}
</li>
<li>
<a href="{{ path('person_document_show', {'person': person.id, 'id': document.id}) }}" class="btn btn-show"></a>
</li>
{% endif %}
{% endif %}
</ul>
{% else %}
<ul class="record_actions">
{% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %}
<li>
{{ m.download_button(document.object, document.title) }}
</li>
<li>
<a href="{{ path('person_document_show', {'person': person.id, 'id': document.id}) }}" class="btn btn-show"></a>
</li>
{% endif %}
{% if is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document) %}
<li>
<a href="{{ path('person_document_edit', {'person': person.id, 'id': document.id}) }}" class="btn btn-update"></a>
</li>
{% endif %}
</ul>
{% endif %}
</div>
</div>

View File

@@ -0,0 +1,43 @@
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = '' %}
{% block title %}{{ 'Delete document ?' }}{% endblock %}
{% block docdescription %}
<dl class="chill_view_data">
<dt>{{ 'Title'|trans }}</dt>
<dd>{{ document.title }}</dd>
{% if document.scope is not null %}
<dt>{{ 'Scope' | trans }}</dt>
<dd>{{ document.scope.name | localize_translatable_string }}</dd>
{% endif %}
<dt>{{ 'Category'|trans }}</dt>
<dd>{{ document.category.name|localize_translatable_string }}</dd>
<dt>{{ 'Description' | trans }}</dt>
<dd>
{% if document.description is empty %}
<span class="chill-no-data-statement">{{ 'Any description'|trans }}</span>
{% else %}
<blockquote class="chill-user-quote">
{{ document.description|chill_markdown_to_html }}
</blockquote>
{% endif %}
</dd>
</dl>
{% endblock %}
{% block personcontent %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Delete document ?'|trans,
'display_content' : block('docdescription'),
'confirm_question' : 'Are you sure you want to remove this document ?'|trans,
'cancel_route' : 'person_document_index',
'cancel_parameters' : {'person' : person.id, 'id': document.id},
'form' : delete_form
} ) }}
{% endblock %}

View File

@@ -36,20 +36,20 @@
{{ form_row(form.description) }}
{{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('person_document_index', {'person': person.id}) }}" class="btn btn-cancel">
<a href="{{ chill_return_path_or('person_document_index', {'person': person.id}) }}" class="btn btn-cancel">
{{ 'Back to the list' | trans }}
</a>
</li>
{% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
<li class="delete">
<a href="{{ chill_return_path_or('chill_docstore_person_document_delete', {'person': person.id, 'id': document.id}) }}" class="btn btn-delete"></a>
</li>
{% endif %}
<li class="edit">
<button class="btn btn-edit">{{ 'Edit'|trans }}</button>
</li>
{# {% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
<li class="delete">
{{ include('ChillDocStoreBundle:PersonDocument:_delete_form.html.twig') }}
</li>
{% endif %} #}
</ul>
{{ form_end(form) }}

View File

@@ -26,7 +26,17 @@
{% endblock %}
{% block js %}
{{ parent() }}
{{ encore_entry_script_tags('mod_async_upload') }}
{{ encore_entry_script_tags('mod_docgen_picktemplate') }}
{{ encore_entry_script_tags('mod_entity_workflow_pick') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('mod_docgen_picktemplate') }}
{{ encore_entry_link_tags('mod_entity_workflow_pick') }}
{% endblock %}
{% block personcontent %}
@@ -46,6 +56,8 @@
{{ chill_pagination(pagination) }}
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-class="Chill\PersonBundle\Entity\Person" data-entity-id="{{ person.id }}"></div>
{% if is_granted('CHILL_PERSON_DOCUMENT_CREATE', person) %}
<ul class="record_actions sticky-form-buttons">
<li class="create">

View File

@@ -40,9 +40,9 @@
{{ form_row(form.description) }}
{{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('person_document_index', {'person': person.id}) }}" class="btn btn-cancel">
<a href="{{ chill_return_path_or('person_document_index', {'person': person.id}) }}" class="btn btn-cancel">
{{ 'Back to the list' | trans }}
</a>
</li>

View File

@@ -64,13 +64,9 @@
</a>
</li>
<li>
{{ m.download_button(document.object, document.title) }}
</li>
{% if chill_document_is_editable(document.object) %}
<li>
{{ document.object|chill_document_edit_button }}
{% if is_granted('CHILL_PERSON_DOCUMENT_DELETE', document) %}
<li class="delete">
<a href="{{ chill_return_path_or('chill_docstore_person_document_delete', {'person': person.id, 'id': document.id}) }}" class="btn btn-delete"></a>
</li>
{% endif %}
@@ -82,5 +78,15 @@
</li>
{% endif %}
{# {{ include('ChillDocStoreBundle:PersonDocument:_delete_form.html.twig') }} #}
<li>
{{ m.download_button(document.object, document.title) }}
</li>
{% if chill_document_is_editable(document.object) %}
<li>
{{ document.object|chill_document_edit_button }}
</li>
{% endif %}
{# {{ include('ChillDocStoreBundle:PersonDocument:_delete_form.html.twig') }} #}
{% endblock %}

View File

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

View File

@@ -15,11 +15,12 @@ use ChampsLibres\WopiLib\Contract\Service\Discovery\DiscoveryInterface;
use Chill\DocStoreBundle\Entity\StoredObject;
use Twig\Environment;
use Twig\Extension\RuntimeExtensionInterface;
use function array_key_exists;
class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface
final class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface
{
public const TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig';
private const TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig';
private DiscoveryInterface $discovery;
@@ -32,10 +33,6 @@ class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface
{
$mime_type = $this->discovery->discoverMimeType($document->getType());
if ([] === $mime_type) {
return false;
}
foreach ($mime_type as $item) {
if (array_key_exists('default', $item) && 'true' === $item['default']) {
return true;

View File

@@ -12,21 +12,61 @@ declare(strict_types=1);
namespace Chill\DocStoreBundle\Workflow;
use Chill\DocStoreBundle\Entity\AccompanyingCourseDocument;
use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Symfony\Contracts\Translation\TranslatorInterface;
class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandlerInterface
{
private EntityRepository $repository;
private TranslatorInterface $translator;
/**
* TODO: injecter le repository directement.
*/
public function __construct(EntityManagerInterface $em)
{
public function __construct(
EntityManagerInterface $em,
TranslatorInterface $translator
) {
$this->repository = $em->getRepository(AccompanyingCourseDocument::class);
$this->translator = $translator;
}
public function getDeletionRoles(): array
{
return [
AccompanyingCourseDocumentVoter::DELETE,
];
}
public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array
{
$course = $this->getRelatedEntity($entityWorkflow)
->getCourse();
$persons = [];
if (null !== $course) {
$persons = $course->getCurrentParticipations()->map(static function (AccompanyingPeriodParticipation $participation) {
return $participation->getPerson();
})->toArray();
}
return [
'persons' => array_values($persons),
];
}
public function getEntityTitle(EntityWorkflow $entityWorkflow, array $options = []): string
{
$doc = $this->getRelatedEntity($entityWorkflow);
return $this->translator->trans('workflow.Document (n°%doc%)', ['%doc%' => $entityWorkflow->getRelatedEntityId()])
. ' - ' . $doc->getTitle();
}
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingCourseDocument
@@ -34,6 +74,18 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler
return $this->repository->find($entityWorkflow->getRelatedEntityId());
}
/**
* @param AccompanyingCourseDocument $object
*
* @return array[]
*/
public function getRelatedObjects(object $object): array
{
return [
['entityClass' => AccompanyingCourseDocument::class, 'entityId' => $object->getId()],
];
}
public function getRoleShow(EntityWorkflow $entityWorkflow): ?string
{
return null;
@@ -52,14 +104,9 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler
];
}
public function getTemplateTitle(EntityWorkflow $entityWorkflow, array $options = []): string
public function isObjectSupported(object $object): bool
{
return '@ChillDocStore/AccompanyingCourseDocument/_workflow.title.html.twig';
}
public function getTemplateTitleData(EntityWorkflow $entityWorkflow, array $options = []): array
{
return $this->getTemplateData($entityWorkflow, $options);
return $object instanceof AccompanyingCourseDocument;
}
public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool

View File

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

View File

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

View File

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

View File

@@ -19,6 +19,12 @@ The document is successfully registered: Le document est enregistré
The document is successfully updated: Le document est mis à jour
Any description: Aucune description
# delete
Delete document ?: Supprimer le document ?
Are you sure you want to remove this document ?: Êtes-vous sûr·e de vouloir supprimer ce document ?
The document is successfully removed: Le document a été supprimé
# dropzone upload
File too big: Fichier trop volumineux
Drop your file or click here: Cliquez ici ou faites glissez votre nouveau fichier dans cette zone

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -20,7 +20,7 @@ class DefaultController extends AbstractController
{
public function indexAction()
{
if ($this->isGranted('ROLE_ADMIN')) {
if ($this->isGranted('ROLE_ADMIN') && !in_array('ROLE_USER',$this->getUser()->getRoles())) {
return $this->redirectToRoute('chill_main_admin_central', [], 302);
}

View File

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

View File

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

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\AddressApiController;
use Chill\MainBundle\Controller\CivilityApiController;
use Chill\MainBundle\Controller\LocationController;
use Chill\MainBundle\Controller\LocationTypeController;
use Chill\MainBundle\Controller\UserController;
@@ -38,6 +39,7 @@ use Chill\MainBundle\Form\LocationTypeType;
use Chill\MainBundle\Form\UserJobType;
use Chill\MainBundle\Form\UserType;
use Exception;
use Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType;
use Ramsey\Uuid\Doctrine\UuidType;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -234,6 +236,7 @@ class ChillMainExtension extends Extension implements
'dateinterval' => NativeDateIntervalType::class,
'point' => PointType::class,
'uuid' => UuidType::class,
'phone_number' => PhoneNumberType::class,
],
],
]
@@ -253,6 +256,13 @@ class ChillMainExtension extends Extension implements
'channels' => ['chill'],
]);
$container->prependExtensionConfig('security', [
'access_decision_manager' => [
'strategy' => 'unanimous',
'allow_if_all_abstain' => false,
],
]);
//add crud api
$this->prependCruds($container);
}
@@ -559,6 +569,21 @@ class ChillMainExtension extends Extension implements
],
],
],
[
'class' => \Chill\MainBundle\Entity\Civility::class,
'name' => 'civility',
'base_path' => '/api/1.0/main/civility',
'base_role' => 'ROLE_USER',
'controller' => CivilityApiController::class,
'actions' => [
'_index' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
],
],
],
],
]);
}

View File

@@ -97,6 +97,9 @@ class Configuration implements ConfigurationInterface
->scalarNode('twilio_secret')
->defaultNull()
->end()
->scalarNode('default_carrier_code')
->defaultNull()
->end()
->end()
->end()
->arrayNode('acl')

View File

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

View File

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

View File

@@ -18,9 +18,9 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
use DateTimeImmutable;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use libphonenumber\PhoneNumber;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="chill_main_location")
@@ -90,20 +90,18 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
private ?string $name = null;
/**
* @ORM\Column(type="string", length=64, nullable=true)
* @ORM\Column(type="phone_number", nullable=true)
* @Serializer\Groups({"read", "write", "docgen:read"})
* @Assert\Regex(pattern="/^([\+{1}])([0-9\s*]{4,20})$/")
* @PhonenumberConstraint(type="any")
*/
private ?string $phonenumber1 = null;
private ?PhoneNumber $phonenumber1 = null;
/**
* @ORM\Column(type="string", length=64, nullable=true)
* @ORM\Column(type="phone_number", nullable=true)
* @Serializer\Groups({"read", "write", "docgen:read"})
* @Assert\Regex(pattern="/^([\+{1}])([0-9\s*]{4,20})$/")
* @PhonenumberConstraint(type="any")
*/
private ?string $phonenumber2 = null;
private ?PhoneNumber $phonenumber2 = null;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
@@ -162,12 +160,12 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
return $this->name;
}
public function getPhonenumber1(): ?string
public function getPhonenumber1(): ?PhoneNumber
{
return $this->phonenumber1;
}
public function getPhonenumber2(): ?string
public function getPhonenumber2(): ?PhoneNumber
{
return $this->phonenumber2;
}
@@ -238,14 +236,14 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
return $this;
}
public function setPhonenumber1(?string $phonenumber1): self
public function setPhonenumber1(?PhoneNumber $phonenumber1): self
{
$this->phonenumber1 = $phonenumber1;
return $this;
}
public function setPhonenumber2(?string $phonenumber2): self
public function setPhonenumber2(?PhoneNumber $phonenumber2): self
{
$this->phonenumber2 = $phonenumber2;

View File

@@ -112,6 +112,11 @@ class User implements AdvancedUserInterface
*/
private string $password = '';
/**
* @ORM\Column(type="json")
*/
private array $roles = ['ROLE_USER'];
/**
* @internal must be set to null if we use bcrypt
*
@@ -146,36 +151,24 @@ class User implements AdvancedUserInterface
$this->groupCenters = new ArrayCollection();
}
/**
* @return string
*/
public function __toString()
public function __toString(): string
{
return $this->getLabel();
}
/**
* @param \Chill\MainBundle\Entity\GroupCenter $groupCenter
*
* @return \Chill\MainBundle\Entity\User
*/
public function addGroupCenter(GroupCenter $groupCenter)
public function addGroupCenter(GroupCenter $groupCenter): self
{
$this->groupCenters->add($groupCenter);
return $this;
}
// empty function... remove?
public function eraseCredentials()
{
}
/**
* Get attributes.
*
* @return array
*/
public function getAttributes()
public function getAttributes(): ?array
{
if (null === $this->attributes) {
$this->attributes = [];
@@ -189,18 +182,12 @@ class User implements AdvancedUserInterface
return $this->currentLocation;
}
/**
* @return string
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* @return string
*/
public function getEmailCanonical()
public function getEmailCanonical(): ?string
{
return $this->emailCanonical;
}
@@ -213,12 +200,7 @@ class User implements AdvancedUserInterface
return $this->groupCenters;
}
/**
* Get id.
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -243,23 +225,17 @@ class User implements AdvancedUserInterface
return $this->mainScope;
}
/**
* @return string
*/
public function getPassword()
public function getPassword(): string
{
return $this->password;
}
public function getRoles(): array
{
return ['ROLE_USER'];
return array_unique($this->roles);
}
/**
* @return string|null
*/
public function getSalt()
public function getSalt(): ?string
{
return $this->salt;
}
@@ -269,50 +245,32 @@ class User implements AdvancedUserInterface
return $this->userJob;
}
/**
* @return string
*/
public function getUsername()
public function getUsername(): string
{
return $this->username;
}
/**
* @return string
*/
public function getUsernameCanonical()
public function getUsernameCanonical(): ?string
{
return $this->usernameCanonical;
}
/**
* @return bool
*/
public function isAccountNonExpired()
public function isAccountNonExpired(): bool
{
return true;
}
/**
* @return bool
*/
public function isAccountNonLocked()
public function isAccountNonLocked(): bool
{
return $this->locked;
}
/**
* @return bool
*/
public function isCredentialsNonExpired()
public function isCredentialsNonExpired(): bool
{
return true;
}
/**
* @return bool
*/
public function isEnabled()
public function isEnabled(): bool
{
return $this->enabled;
}
@@ -363,97 +321,84 @@ class User implements AdvancedUserInterface
return $this;
}
public function setCurrentLocation(?Location $currentLocation): User
public function setCurrentLocation(?Location $currentLocation): self
{
$this->currentLocation = $currentLocation;
return $this;
}
/**
* @param $email
*
* @return $this
*/
public function setEmail($email)
public function setEmail($email): self
{
$this->email = $email;
return $this;
}
/**
* @param $emailCanonical
*
* @return $this
*/
public function setEmailCanonical($emailCanonical)
public function setEmailCanonical($emailCanonical): self
{
$this->emailCanonical = $emailCanonical;
return $this;
}
public function setEnabled(bool $enabled)
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
public function setLabel(string $label): User
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function setMainCenter(?Center $mainCenter): User
public function setMainCenter(?Center $mainCenter): self
{
$this->mainCenter = $mainCenter;
return $this;
}
public function setMainLocation(?Location $mainLocation): User
public function setMainLocation(?Location $mainLocation): self
{
$this->mainLocation = $mainLocation;
return $this;
}
public function setMainScope(?Scope $mainScope): User
public function setMainScope(?Scope $mainScope): self
{
$this->mainScope = $mainScope;
return $this;
}
/**
* @param $password
*
* @return $this
*/
public function setPassword($password)
public function setPassword($password): self
{
$this->password = $password;
return $this;
}
/**
* @param $salt
*
* @return $this
*/
public function setSalt($salt)
public function setRoles($roles): self
{
$this->roles = $roles;
return $this;
}
public function setSalt($salt): self
{
$this->salt = $salt;
return $this;
}
public function setUserJob(?UserJob $userJob): User
public function setUserJob(?UserJob $userJob): self
{
$this->userJob = $userJob;
@@ -478,12 +423,7 @@ class User implements AdvancedUserInterface
return $this;
}
/**
* @param $usernameCanonical
*
* @return $this
*/
public function setUsernameCanonical($usernameCanonical)
public function setUsernameCanonical($usernameCanonical): self
{
$this->usernameCanonical = $usernameCanonical;

View File

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

View File

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

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\LocationType as EntityLocationType;
use Chill\MainBundle\Form\Type\ChillPhoneNumberType;
use Chill\MainBundle\Form\Type\PickAddressType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
@@ -46,8 +47,8 @@ final class LocationFormType extends AbstractType
},
])
->add('name', TextType::class)
->add('phonenumber1', TextType::class, ['required' => false])
->add('phonenumber2', TextType::class, ['required' => false])
->add('phonenumber1', ChillPhoneNumberType::class, ['required' => false])
->add('phonenumber2', ChillPhoneNumberType::class, ['required' => false])
->add('email', TextType::class, ['required' => false])
->add('address', PickAddressType::class, [
'required' => false,

View File

@@ -0,0 +1,61 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Form\Type;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use Misd\PhoneNumberBundle\Form\Type\PhoneNumberType;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use function array_key_exists;
class ChillPhoneNumberType extends AbstractType
{
private string $defaultCarrierCode;
private PhoneNumberUtil $phoneNumberUtil;
public function __construct(ParameterBagInterface $parameterBag)
{
$this->defaultCarrierCode = $parameterBag->get('chill_main')['phone_helper']['default_carrier_code'];
$this->phoneNumberUtil = PhoneNumberUtil::getInstance();
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('default_region', $this->defaultCarrierCode)
->setDefault('format', PhoneNumberFormat::NATIONAL)
->setDefault('type', \libphonenumber\PhoneNumberType::FIXED_LINE_OR_MOBILE)
->setNormalizer('attr', function (Options $options, $value) {
if (array_key_exists('placeholder', $value)) {
return $value;
}
$examplePhoneNumber = $this->phoneNumberUtil->getExampleNumberForType($this->defaultCarrierCode, $options['type']);
return array_merge(
$value,
[
'placeholder' => PhoneNumberUtil::getInstance()->format($examplePhoneNumber, $options['format']),
]
);
});
}
public function getParent()
{
return PhoneNumberType::class;
}
}

View File

@@ -38,7 +38,7 @@ class ObjectToIdTransformer implements DataTransformerInterface
*/
public function reverseTransform($id)
{
if (!$id) {
if (null === $id) {
return null;
}
@@ -46,7 +46,7 @@ class ObjectToIdTransformer implements DataTransformerInterface
->getRepository($this->class)
->find($id);
if (!$object) {
if (null === $object) {
throw new TransformationFailedException();
}
@@ -62,7 +62,7 @@ class ObjectToIdTransformer implements DataTransformerInterface
*/
public function transform($object)
{
if (!$object) {
if (null === $object) {
return '';
}

View File

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

View File

@@ -19,6 +19,7 @@ use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
@@ -59,6 +60,16 @@ class UserType extends AbstractType
return $qb;
},
])
->add('roles', ChoiceType::class, [
'required' => true,
'multiple' => true,
'expanded' => true,
'label' => 'Roles',
'choices' => [
'Usager' => 'ROLE_USER',
'Administrateur' => 'ROLE_ADMIN',
],
])
->add('mainScope', EntityType::class, [
'label' => 'Main scope',
'required' => false,
@@ -94,6 +105,18 @@ class UserType extends AbstractType
},
]);
// $builder->get('roles')
// ->addModelTransformer(new CallbackTransformer(
// function ($rolesArray) {
// // transform the array to a string
// return count($rolesArray)? $rolesArray[0]: null;
// },
// function ($rolesString) {
// // transform the string back to an array
// return [$rolesString];
// }
// ));
if ($options['is_creation']) {
$builder->add('plainPassword', RepeatedType::class, [
'mapped' => false,

View File

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

View File

@@ -0,0 +1,54 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Phonenumber;
use libphonenumber\PhoneNumber;
/**
* Helper to some task linked to phonenumber.
*
* Currently, only Twilio is supported (https://www.twilio.com/lookup). A method
* allow to check if the helper is configured for validation. This should be used
* before doing some validation.
*/
interface PhoneNumberHelperInterface
{
public function format(PhoneNumber $phoneNumber): string;
/**
* Get type (mobile, landline, ...) for phone number.
*/
public function getType(PhoneNumber $phonenumber): string;
/**
* Return true if the validation is configured and available.
*/
public function isPhonenumberValidationConfigured(): bool;
/**
* Return true if the phonenumber is a landline or voip phone. Return always true
* if the validation is not configured.
*/
public function isValidPhonenumberAny(string $phonenumber): bool;
/**
* Return true if the phonenumber is a landline or voip phone. Return always true
* if the validation is not configured.
*/
public function isValidPhonenumberLandOrVoip(string $phonenumber): bool;
/**
* REturn true if the phoennumber is a mobile phone. Return always true
* if the validation is not configured.
*/
public function isValidPhonenumberMobile(string $phonenumber): bool;
}

View File

@@ -15,8 +15,13 @@ use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\ServerException;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumber;
use libphonenumber\PhoneNumberType;
use libphonenumber\PhoneNumberUtil;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use function array_key_exists;
use function in_array;
@@ -24,40 +29,32 @@ use function json_decode;
use function preg_replace;
use function strlen;
/**
* Helper to some task linked to phonenumber.
*
* Currently, only Twilio is supported (https://www.twilio.com/lookup). A method
* allow to check if the helper is configured for validation. This should be used
* before doing some validation.
*/
class PhonenumberHelper
final class PhonenumberHelper implements PhoneNumberHelperInterface
{
public const FORMAT_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s';
public const LOOKUP_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s';
protected CacheItemPoolInterface $cachePool;
private CacheItemPoolInterface $cachePool;
/**
* TRUE if the client is properly configured.
*/
protected bool $isConfigured = false;
private array $config;
protected LoggerInterface $logger;
private bool $isConfigured = false;
/**
* Twilio client.
*/
protected Client $twilioClient;
private LoggerInterface $logger;
private PhonenumberUtil $phoneNumberUtil;
private Client $twilioClient;
public function __construct(
CacheItemPoolInterface $cachePool,
$config,
CacheItemPoolInterface $cacheUserData,
ParameterBagInterface $parameterBag,
LoggerInterface $logger
) {
$this->logger = $logger;
$this->cachePool = $cachePool;
$this->cachePool = $cacheUserData;
$this->config = $config = $parameterBag->get('chill_main.phone_helper');
if (
array_key_exists('twilio_sid', $config)
@@ -72,19 +69,37 @@ class PhonenumberHelper
]);
$this->isConfigured = true;
}
$this->phoneNumberUtil = PhoneNumberUtil::getInstance();
}
public function format($phonenumber)
/**
* @param string $phoneNumber A national phone number starting with +
*
* @throws NumberParseException
*/
public function format(PhoneNumber $phoneNumber): string
{
return $this->performTwilioFormat($phonenumber);
return $this->phoneNumberUtil
->formatOutOfCountryCallingNumber($phoneNumber, $this->config['default_carrier_code']);
}
/**
* Get type (mobile, landline, ...) for phone number.
*/
public function getType(string $phonenumber): string
public function getType(PhoneNumber $phonenumber): string
{
return $this->performTwilioLookup($phonenumber) ?? 'unknown';
switch ($this->phoneNumberUtil->getNumberType($phonenumber)) {
case PhoneNumberType::MOBILE:
return 'mobile';
case PhoneNumberType::FIXED_LINE:
case PhoneNumberType::VOIP:
return 'landline';
default:
return 'landline';
}
}
/**
@@ -137,7 +152,7 @@ class PhonenumberHelper
}
/**
* REturn true if the phoennumber is a mobile phone. Return always true
* REturn true if the phonenumber is a mobile phone. Return always true
* if the validation is not configured.
*
* @param string $phonenumber
@@ -157,68 +172,7 @@ class PhonenumberHelper
return 'mobile' === $validation;
}
protected function performTwilioFormat($phonenumber)
{
if (false === $this->isPhonenumberValidationConfigured()) {
return $phonenumber;
}
// filter only number
$filtered = preg_replace('/[^0-9]/', '', $phonenumber);
$item = $this->cachePool->getItem('pnum_format_nat_' . $filtered);
if ($item->isHit()) {
return $item->get();
}
try {
$response = $this->twilioClient->get(sprintf(self::FORMAT_URI, '+' . $filtered), [
'http_errors' => true,
]);
} catch (ClientException $e) {
$response = $e->getResponse();
$this->logger->error('[phonenumber helper] Could not format number '
. 'due to client error', [
'message' => $response->getBody()->getContents(),
'status_code' => $response->getStatusCode(),
'phonenumber' => $phonenumber,
]);
return $phonenumber;
} catch (ServerException $e) {
$response = $e->getResponse();
$this->logger->error('[phonenumber helper] Could not format number '
. 'due to server error', [
'message' => $response->getBody()->getContents(),
'status_code' => $response->getStatusCode(),
'phonenumber' => $phonenumber,
]);
return null;
} catch (ConnectException $e) {
$this->logger->error('[phonenumber helper] Could not format number '
. 'due to connect error', [
'message' => $e->getMessage(),
'phonenumber' => $phonenumber,
]);
return null;
}
$format = json_decode($response->getBody()->getContents())->national_format;
$item
->set($format)
// expires after 3d
->expiresAfter(3600 * 24 * 3);
$this->cachePool->save($item);
return $format;
}
protected function performTwilioLookup($phonenumber)
private function performTwilioLookup($phonenumber)
{
if (false === $this->isPhonenumberValidationConfigured()) {
return null;
@@ -230,7 +184,7 @@ class PhonenumberHelper
$item = $this->cachePool->getItem('pnum_' . $filtered);
if ($item->isHit()) {
//return $item->get();
return $item->get();
}
try {

View File

@@ -16,10 +16,7 @@ use Twig\TwigFilter;
class Templating extends AbstractExtension
{
/**
* @var PhonenumberHelper
*/
protected $phonenumberHelper;
protected PhonenumberHelper $phonenumberHelper;
public function __construct(PhonenumberHelper $phonenumberHelper)
{

View File

@@ -34,6 +34,20 @@ class EntityWorkflowRepository implements ObjectRepository
return (int) $qb->getQuery()->getSingleScalarResult();
}
public function countByPreviousDestWithoutReaction(User $user): int
{
$qb = $this->buildQueryByPreviousDestWithoutReaction($user)->select('count(ew)');
return (int) $qb->getQuery()->getSingleScalarResult();
}
public function countByPreviousTransitionned(User $user): int
{
$qb = $this->buildQueryByPreviousTransitionned($user)->select('count(ew)');
return (int) $qb->getQuery()->getSingleScalarResult();
}
public function countBySubscriber(User $user): int
{
$qb = $this->buildQueryBySubscriber($user)->select('count(ew)');
@@ -41,6 +55,30 @@ class EntityWorkflowRepository implements ObjectRepository
return (int) $qb->getQuery()->getSingleScalarResult();
}
public function countRelatedWorkflows(array $relateds): int
{
$qb = $this->repository->createQueryBuilder('w');
$orX = $qb->expr()->orX();
$i = 0;
foreach ($relateds as $related) {
$orX->add(
$qb->expr()->andX(
$qb->expr()->eq('w.relatedEntityClass', ':entity_class_' . $i),
$qb->expr()->eq('w.relatedEntityId', ':entity_id_' . $i)
)
);
$qb
->setParameter('entity_class_' . $i, $related['entityClass'])
->setParameter('entity_id_' . $i, $related['entityId']);
++$i;
}
$qb->where($orX);
return $qb->select('COUNT(w)')->getQuery()->getSingleScalarResult();
}
public function find($id): ?EntityWorkflow
{
return $this->repository->find($id);
@@ -78,6 +116,32 @@ class EntityWorkflowRepository implements ObjectRepository
return $qb->getQuery()->getResult();
}
public function findByPreviousDestWithoutReaction(User $user, ?array $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->buildQueryByPreviousDestWithoutReaction($user)->select('ew');
foreach ($orderBy as $key => $sort) {
$qb->addOrderBy('ew.' . $key, $sort);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()->getResult();
}
public function findByPreviousTransitionned(User $user, ?array $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->buildQueryByPreviousTransitionned($user)->select('ew')->distinct(true);
foreach ($orderBy as $key => $sort) {
$qb->addOrderBy('ew.' . $key, $sort);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()->getResult();
}
public function findBySubscriber(User $user, ?array $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->buildQueryBySubscriber($user)->select('ew');
@@ -120,6 +184,41 @@ class EntityWorkflowRepository implements ObjectRepository
return $qb;
}
private function buildQueryByPreviousDestWithoutReaction(User $user): QueryBuilder
{
$qb = $this->repository->createQueryBuilder('ew');
$qb->join('ew.steps', 'step');
$qb->where(
$qb->expr()->andX(
$qb->expr()->isMemberOf(':user', 'step.destUser'),
$qb->expr()->neq('step.transitionBy', ':user'),
)
);
$qb->setParameter('user', $user);
return $qb;
}
private function buildQueryByPreviousTransitionned(User $user): QueryBuilder
{
$qb = $this->repository->createQueryBuilder('ew');
$qb->join('ew.steps', 'step');
$qb->where(
$qb->expr()->andX(
$qb->expr()->eq('step.transitionBy', ':user'),
)
);
$qb->setParameter('user', $user);
return $qb;
}
private function buildQueryBySubscriber(User $user): QueryBuilder
{
$qb = $this->repository->createQueryBuilder('ew');

View File

@@ -278,6 +278,7 @@ table.table-bordered {
}
/// meta-data
div.createdBy,
div.updatedBy,
div.metadata {
span.user, span.date {

View File

@@ -279,6 +279,7 @@ div.wrap-header {
li {
margin-right: 5px;
margin-bottom: 5px;
}
}
}
@@ -316,7 +317,7 @@ div.float-button {
div.action {
height: calc(100% - 0em);
shape-outside: inset(calc(100% - 4em) 0 0);
shape-outside: inset(calc(100% - 2em) 0 0);
display: flex;
align-items: flex-end;
padding: 0 0 0 1em;
@@ -328,6 +329,10 @@ div.float-button {
padding: 0;
}
}
.chill-entity.entity-address .address p {
display: unset;
}
}
&.debug {
padding: 1em;

View File

@@ -1,7 +1,7 @@
ul.record_actions {
display: flex;
flex-direction: row;
flex-wrap: wrap-reverse;
flex-wrap: wrap;
justify-content: flex-end;
padding: 0.5em 0;

View File

@@ -73,8 +73,8 @@ section.chill-entity {
}
p {
display: inline-block;
margin: 0 0 0 1.5em;
text-indent: -1.5em;
//margin: 0 0 0 1.5em;
//text-indent: -1.5em;
&.street {
span.streetnumber {

View File

@@ -1,7 +1,7 @@
/**
* Generic api method that can be adapted to any fetch request
*/
const makeFetch = (method, url, body) => {
const makeFetch = (method, url, body) => {
return fetch(url, {
method: method,
headers: {
@@ -11,19 +11,20 @@
})
.then(response => {
if (response.ok) {
console.log('200 error')
return response.json();
}
if (response.status === 422) {
console.log('422 error')
return response.json().then(response => {
throw ValidationException(response)
});
}
if (response.status === 403) {
return response.json().then(() => {
throw AccessException();
});
console.log('403 error')
throw AccessException(response);
}
throw {
@@ -88,14 +89,13 @@ const ValidationException = (response) => {
error.violations = response.violations.map((violation) => `${violation.title}: ${violation.propertyPath}`);
error.titles = response.violations.map((violation) => violation.title);
error.propertyPaths = response.violations.map((violation) => violation.propertyPath);
return error;
}
const AccessException = () => {
const AccessException = (response) => {
const error = {};
error.name = 'AccessException';
error.violations = ['You are no longer permitted to perform this action'];
error.violations = ['You are not allowed to perform this action'];
return error;
}

View File

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

View File

@@ -1,11 +1,39 @@
.confidential{
.confidential {
display: flex;
position: relative;
}
.toggle-far-twig {
i {
bottom: 0px;
right: -30px;
}
}
.toggle-close-twig {
i {
bottom: 0px;
right: -5px;
}
}
.toggle{
margin-left: 30px;
margin-top: 5px;
cursor: pointer;
position: absolute;
z-index: 5;
right: -30px
}
.toggle-far {
bottom: 0px;
right: 20px !important;
}
.toggle-close {
bottom: 125px;
right: 15px !important;
}
.blur {
-webkit-filter: blur(5px);
-moz-filter: blur(5px);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
<template>
<div :class="classes">
<div class="confidential-content" :class="{ 'blur': isBlurred }">
<div class="confidential">
<div :class="{ 'blur': isBlurred }">
<slot name="confidential-content"></slot>
</div>
<div>
<i class="fa fa-eye toggle" aria-hidden="true" @click="toggleBlur"></i>
<i class="fa fa-eye toggle" :class="positionBtn" aria-hidden="true" @click="toggleBlur"></i>
</div>
</div>
</template>
@@ -12,6 +12,7 @@
<script>
export default {
name: "Confidential",
props: ['positionBtnFar'],
data() {
return {
isBlurred: true,
@@ -19,9 +20,14 @@ export default {
},
methods : {
toggleBlur() {
console.log('toggle blur');
console.log(this.positionBtnFar);
this.isBlurred = !this.isBlurred;
},
},
computed: {
positionBtn() {
return this.positionBtnFar ? 'toggle-far' : 'toggle-close'
}
}
}
</script>
@@ -29,18 +35,5 @@ export default {
<style scoped lang='scss'>
.confidential{
align-items: center;
display: flex;
}
.toggle{
margin-top: 28px;
cursor: pointer;
display: block;
float: right;
margin-right: 20px;
}
.blur {
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
filter: blur(5px);
}
</style>

View File

@@ -5,7 +5,7 @@
<component :is="component" class="address" :class="multiline">
<div v-if="isConfidential">
<confidential>
<confidential :positionBtnFar="true">
<template v-slot:confidential-content>
<div v-if="isMultiline === true">
<p v-for="(l, i) in address.lines" :key="`line-${i}`">
@@ -27,7 +27,6 @@
</p>
</div>
</template>
</confidential>
</div>
@@ -94,6 +93,7 @@ export default {
return this.isMultiline === true ? "multiline" : "";
},
isConfidential() {
console.log(this.address.confidential)
return this.address.confidential;
}
}

View File

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

View File

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

View File

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

View File

@@ -46,7 +46,8 @@ const messages = {
person: "Quitter la page et ouvrir la fiche de l'usager",
thirdparty: "Quitter la page et voir le tiers",
},
refresh: 'Rafraîchir'
refresh: 'Rafraîchir',
addContact: 'Ajouter un contact'
},
nav: {
next: "Suivant",
@@ -69,7 +70,8 @@ const messages = {
},
holder: "Titulaire",
years_old: "an | {n} an | {n} ans",
residential_address: "Adresse de résidence",
located_at: "réside chez"
}
}
};

View File

@@ -59,7 +59,7 @@
must be shown in such list
#}
{%- if render == 'list' -%}
<li class="chill-entity entity-address {% if address.confidential %}confidential{% endif %}">
<li class="chill-entity entity-address {% if address.confidential %} confidential toggle-far-twig {% endif %}">
{% if options['with_picto'] %}
<i class="fa fa-li fa-map-marker"></i>
{% endif %}
@@ -68,7 +68,7 @@
{%- endif -%}
{%- if render == 'inline' -%}
<span class="chill-entity entity-address {% if address.confidential %}confidential{% endif %}">
<span class="chill-entity entity-address {% if address.confidential %} confidential toggle-far-twig {% endif %}">
{% if options['with_picto'] %}
<i class="fa fa-fw fa-map-marker"></i>
{% endif %}
@@ -77,7 +77,7 @@
{%- endif -%}
{%- if render == 'bloc' -%}
<div class="chill-entity entity-address {% if address.confidential %}confidential{% endif %}">
<div class="chill-entity entity-address {% if address.confidential %} confidential toggle-close-twig {% endif %}">
{% if options['has_no_address'] == true and address.isNoAddress == true %}
{% if address.postCode is not empty %}
<div class="address{% if options['multiline'] %} multiline{% endif %}{% if options['with_delimiter'] %} delimiter{% endif %}">

View File

@@ -18,8 +18,10 @@
{% for entity in entities %}
<tr>
<td>{{ entity.name }}</td>
<td>{{ entity.phonenumber1 }}</td>
<td>{{ entity.phonenumber2 }}</td>
<td>
{{ entity.phonenumber1|chill_format_phonenumber }}
</td>
<td>{{ entity.phonenumber2|chill_format_phonenumber }}</td>
<td>{{ entity.email }}</td>
<td>
{% if entity.address is not null %}

View File

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

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