Compare commits

...

2738 Commits

Author SHA1 Message Date
julielenaerts 61c2a0ea42 allow for phonenumber or mobilenumber to be left empty for person 2022-03-31 10:27:16 +02:00
julielenaerts dcddf4b3f1 trim email 2022-03-31 10:24:58 +02:00
julienfastre e027958c63 Merge branch 'fix-tests-2022-03-30' into 'master'
Fix tests 2022 03 30

See merge request Chill-Projet/chill-bundles!400
2022-03-30 20:20:03 +00:00
julienfastre 034a416612 fix test which fails randomly 2022-03-30 22:02:45 +02:00
julienfastre 63cdc97c47 fix phpstan errors on ThirdPartyRender 2022-03-30 21:52:43 +02:00
julienfastre ae10a8bd1c fix post action on api controller: too many argument 2022-03-30 21:51:39 +02:00
julienfastre eb2bad0f47 docgen normalization budget: fix budget when person is null 2022-03-30 21:35:02 +02:00
julienfastre bc43d8bae5 force type on Person entity 2022-03-30 21:01:17 +02:00
julienfastre 83dfe530e9 household editor: handle case when the person is repositionned in the
same household, and the person is already in a position "without
household"
2022-03-30 17:00:07 +02:00
julienfastre c477996acf fix cs 2022-03-30 16:43:16 +02:00
julienfastre 36b1f05524 do not launch PersonMoveEvent when moving to the same household 2022-03-30 16:42:57 +02:00
julienfastre dae9d48574 really do not show thirdparty which are not active 2022-03-30 15:26:45 +02:00
julienfastre 9812710cd0 do not show duplicate menu entry temporarily 2022-03-30 15:08:34 +02:00
julienfastre 3b083c31e7 add tests for moving to not share position in another household 2022-03-30 12:57:16 +02:00
julienfastre 1b567327b7 fix normalisation for phonenumber in person entity 2022-03-30 12:37:18 +02:00
julienfastre 38e92ee981 fix cs 2022-03-30 11:58:17 +02:00
julienfastre e433b6a42b Do not dispatch PersonMoveEvent if moving to a position not sharing
household
2022-03-30 11:57:43 +02:00
julienfastre df24d085ca Household members editor: leave household when repositionning to same
household, not sharing household
2022-03-30 11:53:06 +02:00
julienfastre de4f65fede change strategy for searching: use the AND between words, instead of OR 2022-03-29 12:42:17 +02:00
julielenaerts 961c0a867c workflow notification display block for social action item 2022-03-28 11:42:24 +02:00
julielenaerts f5327fe8ab trailing guillemet removed 2022-03-28 11:25:07 +02:00
julielenaerts 6f270188f7 buttons made sticky for parcours documents 2022-03-28 11:22:42 +02:00
julielenaerts 5895334244 update changelog 2022-03-25 17:23:14 +01:00
julielenaerts 1812592d43 fix create person on the fly 2022-03-25 17:22:10 +01:00
julielenaerts 3babbe5e84 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-25 17:06:06 +01:00
julielenaerts 632ea710c8 budget menu entry placed in different order 2022-03-25 17:05:41 +01:00
julienfastre bdcb135adb re-introduce link to create user 2022-03-25 15:48:30 +01:00
julienfastre 3b93d2c0a5 Merge remote-tracking branch 'origin/master' 2022-03-25 14:28:18 +01:00
julienfastre f24b2931dd Merge branch 'issue585_canEditWopiDocument' into 'master'
Accompanying course evaluation documents: disable the WOPI edit link if mimetype not supported

See merge request Chill-Projet/chill-bundles!394
2022-03-25 13:04:24 +00:00
julienfastre c1e972963f invert condition with key infos 2022-03-25 14:03:43 +01:00
julienfastre ce2e05464f Merge remote-tracking branch 'origin/master' into issue585_canEditWopiDocument 2022-03-25 13:48:46 +01:00
julienfastre dbe0c9097f Merge branch 'issue533_notification_for_workflow_bug' into 'master'
correct notification for workflow display bug

See merge request Chill-Projet/chill-bundles!393
2022-03-25 12:39:46 +00:00
julienfastre e68c12e0e7 fix cs 2022-03-25 13:39:27 +01:00
julienfastre c99a967fb9 slightly improvve the render box for workflow in notification 2022-03-25 13:35:52 +01:00
julienfastre d11eebefae fix some authorization check in menu 2022-03-25 13:11:03 +01:00
julienfastre b423821ae9 check existence of form before using it 2022-03-25 13:10:40 +01:00
julienfastre 7a0234adb2 Merge remote-tracking branch 'origin/master' into issue533_notification_for_workflow_bug 2022-03-25 12:45:29 +01:00
nobohan f36fc0ba60 upd CHANGELOG 2022-03-25 11:46:57 +01:00
nobohan cff126953e Accompanying course evaluation documents: disable the WOPI edit link if no keyInfos 2022-03-25 11:45:13 +01:00
nobohan 89064f55a1 Accompanying course evaluation documents: disable the WOPI edit link if mimetype not supported 2022-03-25 11:36:51 +01:00
julielenaerts f69dab5ca5 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-25 11:09:23 +01:00
julielenaerts 259cdd34c4 fix validation person resource 2022-03-25 11:07:12 +01:00
nobohan 9dca42e242 correct notification for workflow display bug 2022-03-25 10:44:15 +01:00
nobohan 248e4e93ed quick fix: change style of input field for document title in AccompanyingCourseWork documents 2022-03-25 10:16:48 +01:00
nobohan db2bf1e98e quick fix: change style of input field for document title in AccompanyingCourseWork documents 2022-03-25 10:15:33 +01:00
julienfastre ea66db07a4 fix cs 2022-03-24 22:10:07 +01:00
julienfastre 5f35a42fe3 allow phonumber helper to format null value 2022-03-24 22:09:12 +01:00
julienfastre e82b2bd10a fix personcontent / content switch in some pages 2022-03-24 20:54:34 +01:00
julienfastre ad4f400262 Merge remote-tracking branch 'origin/master' 2022-03-24 20:53:40 +01:00
julienfastre 866bcec114 Merge remote-tracking branch 'origin/master' 2022-03-24 20:53:10 +01:00
julienfastre 367188b03d Merge branch 'issue491_thirdparty_edit_modal' into 'master'
Thirdparty: fix edit modal + add firstname

See merge request Chill-Projet/chill-bundles!379
2022-03-24 18:33:31 +00:00
julienfastre dd4d463c42 fix bug when setting civility to null in on the fly 2022-03-24 19:32:53 +01:00
julienfastre 1031f0d40e thirdparty: firstname after name in form 2022-03-24 19:18:48 +01:00
julienfastre 5d7943f871 index firstname in database 2022-03-24 19:06:53 +01:00
julienfastre d0c34c0206 set empty thridparty.firstname to a string 2022-03-24 18:51:29 +01:00
julienfastre 726b8f0e3c Merge remote-tracking branch 'origin/master' into issue491_thirdparty_edit_modal 2022-03-24 18:44:42 +01:00
julienfastre 5d4149db35 Merge remote-tracking branch 'origin/issue491_thirdparty_edit_modal' into issue491_thirdparty_edit_modal 2022-03-24 18:41:22 +01:00
julienfastre f04474c82f Merge branch 'issue494_activity_field_visibility' into 'master'
Activity display fields based on ActivityType + show error message

See merge request Chill-Projet/chill-bundles!376
2022-03-24 17:29:38 +00:00
julienfastre 156398caba Merge remote-tracking branch 'origin/master' into issue494_activity_field_visibility 2022-03-24 18:25:03 +01:00
julienfastre ae3091f620 Merge branch 'issue469_budget' into 'master'
Adapt BudgetBundle to Vendee

See merge request Chill-Projet/chill-bundles!357
2022-03-24 17:23:26 +00:00
julienfastre 84f9fdba28 add budget to docgen 2022-03-24 18:22:49 +01:00
julienfastre 531f940b65 add a debug feature in docgenerator template controller 2022-03-24 18:22:36 +01:00
julienfastre d907f3f11b desactivate calculator in current budget for household 2022-03-24 16:29:13 +01:00
julienfastre 02409d4992 Merge remote-tracking branch 'origin/master' into issue469_budget 2022-03-24 16:22:52 +01:00
julienfastre 771b6a59a5 Merge branch 'issue519_filiation_create_person' into 'master'
Add person to filiation

See merge request Chill-Projet/chill-bundles!392
2022-03-24 14:08:54 +00:00
julienfastre 2e336ac874 update case when the person was already on the graph 2022-03-24 15:07:46 +01:00
julielenaerts a61c9553e1 csfixes 2022-03-24 11:42:16 +01:00
julielenaerts 3243a7e0a2 fix merge conflict in changelog 2022-03-24 11:41:02 +01:00
julielenaerts 06cc84a21f conditional statements to allow for personne moral creation and edit 2022-03-24 11:40:06 +01:00
julielenaerts 688914906d merge firstname branch 2022-03-24 11:13:07 +01:00
julienfastre f9d87876f2 Merge remote-tracking branch 'origin/master' into issue519_filiation_create_person 2022-03-24 11:12:56 +01:00
julienfastre 7df70cab98 allow a user/referrer to see his own courses, even if the scope is not his own 2022-03-24 10:58:43 +01:00
julielenaerts 287ea80be9 Merge remote-tracking branch 'origin/master' into issue491_thirdparty_edit_modal 2022-03-24 10:56:51 +01:00
julielenaerts dc3d88a1ef final fix to make current civility and profession values visible in edit form 2022-03-24 10:56:28 +01:00
julielenaerts cba6394823 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-24 09:10:53 +01:00
julielenaerts eea0711a04 autowire sectionmenu service 2022-03-24 09:10:32 +01:00
julienfastre 949bdfd993 add missing property (phpstanerror) 2022-03-23 22:59:45 +01:00
julienfastre 3067da5d24 fix tests for removing temporarily resources on person 2022-03-23 22:56:45 +01:00
julienfastre 546c925224 Enforce a limit for search results when searching through api 2022-03-23 22:51:45 +01:00
julienfastre d7b5944c5f temporarily desactivate resources for docgen 2022-03-23 22:51:45 +01:00
julielenaerts aa234e0749 activity annexe button made sticky 2022-03-23 17:33:23 +01:00
julielenaerts 506118b3f1 edit and create of thirdparty pers physique is possible, but current civility and profession don't display yet in edit form 2022-03-23 16:10:02 +01:00
julielenaerts 52a78902f7 Merge remote-tracking branch 'origin/master' into issue491_thirdparty_edit_modal 2022-03-23 15:53:55 +01:00
julielenaerts e89489fde9 update changelog 2022-03-23 15:04:52 +01:00
julielenaerts a7be9c0a83 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-23 14:59:44 +01:00
julielenaerts 6331d8fd3e validation fix for person ressource 2022-03-23 14:59:30 +01:00
nobohan eb6790b17d quick fix: missing translation 2022-03-23 14:58:09 +01:00
LenaertsJ 61f010f5ad Merge branch 'issue507_conditional_menu_entries' into 'master'
Options added for section menu entries

See merge request Chill-Projet/chill-bundles!391
2022-03-23 13:23:32 +00:00
julielenaerts 30fd36b741 forgotten translation added 2022-03-23 14:16:38 +01:00
julielenaerts 91aacb91cc merge master into branch 2022-03-23 14:07:26 +01:00
julienfastre 73c17febd9 remove inter database reference 2022-03-23 00:05:36 +01:00
julienfastre 99dc9dd4a8 handle case when user is null in comment embeddable 2022-03-22 23:36:02 +01:00
julienfastre c5ffca22ff ease docgen normlisation for resources 2022-03-22 22:37:19 +01:00
julienfastre 89e7eb85ff fix cs 2022-03-22 22:36:01 +01:00
julielenaerts 98d5de29b0 translations added 2022-03-22 16:09:03 +01:00
julielenaerts 4939c8c8e4 changelog updated 2022-03-22 15:50:31 +01:00
julielenaerts 8d5c66dc40 person can be added to filiation graph and relationship created 2022-03-22 15:49:25 +01:00
julielenaerts 2c6cbeb8ca minor fix in vue component to update thirdparty firstname 2022-03-22 11:30:33 +01:00
julielenaerts 13a7d791a1 fixes to allow for firstname value of null 2022-03-22 11:07:26 +01:00
julielenaerts ae555fed00 migration executed down and new one created to allow firstname nullable 2022-03-22 11:07:05 +01:00
julienfastre 6d65009987 Merge remote-tracking branch 'origin/master' 2022-03-21 18:05:38 +01:00
julienfastre 386e88387d Merge branch 'issue560_ACCent_parcours_household' into 'master'
Create parcours from within household context

See merge request Chill-Projet/chill-bundles!390
2022-03-21 17:05:00 +00:00
julienfastre 22473d6547 Merge remote-tracking branch 'origin/master' into issue560_ACCent_parcours_household 2022-03-21 18:01:26 +01:00
julienfastre e7b4f1a54f Merge branch 'issues546_553_554_documents_acc_period_activity' into 'master'
issues553_554_documents_activity

See merge request Chill-Projet/chill-bundles!389
2022-03-21 17:00:21 +00:00
julienfastre 1f6565d2ef add return path when creating an activity 2022-03-21 17:59:41 +01:00
julienfastre e838a82556 Merge remote-tracking branch 'origin/master' into issues546_553_554_documents_acc_period_activity 2022-03-21 17:35:10 +01:00
julienfastre eebca7b0f1 Merge branch 'issue517_extend_document_to_person_vendee' into 'master'
commentembeddable: add a condition for the early return in normalisation

See merge request Chill-Projet/chill-bundles!388
2022-03-21 16:33:23 +00:00
julienfastre 169d4dc41c finalize normalization on ressources 2022-03-21 17:33:01 +01:00
julielenaerts 9e063180bf forgotten translation 2022-03-21 16:37:14 +01:00
julielenaerts 5b0b15f395 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-21 16:23:16 +01:00
julielenaerts 736d43e756 translation fixed 2022-03-21 16:23:06 +01:00
julienfastre b4add2de95 Merge remote-tracking branch 'origin/master' into issue517_extend_document_to_person_vendee 2022-03-21 16:20:03 +01:00
julienfastre 37a8928e41 remove dump 2022-03-21 16:19:27 +01:00
julienfastre 0a0243eb85 Merge branch 'issue511_document_evaluations' into 'master'
AccompanyingCourseWorkEdit: replace document by a new one, fix deleting

See merge request Chill-Projet/chill-bundles!384
2022-03-21 15:17:34 +00:00
julienfastre a6c7c1d997 fix tests for user 2022-03-21 16:17:19 +01:00
julielenaerts c7caa2ba76 addpersons component, doesnt hear emitted event... 2022-03-21 16:13:02 +01:00
julienfastre 2ce8b1110d allow to change color for asyncupload button 2022-03-21 16:13:02 +01:00
julienfastre 11d57094e8 fix cs 2022-03-21 15:22:40 +01:00
julienfastre 704392a729 do not add referrer if user is null (fix condition) 2022-03-21 15:21:29 +01:00
julienfastre efeda81e05 do not add referrer if user is null 2022-03-21 15:17:33 +01:00
julienfastre ae5940eb48 Merge remote-tracking branch 'origin/master' into issue511_document_evaluations 2022-03-21 15:00:40 +01:00
julienfastre 638ae3315f Merge branch 'issue509_parcours_referent' into 'master'
Reassign parcours of absent user

See merge request Chill-Projet/chill-bundles!387
2022-03-21 13:58:33 +00:00
julienfastre ac9e55e2fc fix methods for accompanying period repository acl aware
* add method to interface
* delegate ACL to another method
2022-03-21 14:54:01 +01:00
julienfastre 293efc03b4 fixes for reasign list
* use existing method in UserRepository and use a method instead of
building a query outside of the repository;
* use renderString to render users
* fix building of filter form (add $data). This make the use of the
method "get" instead of post
2022-03-21 13:35:14 +01:00
julienfastre f084078cf2 Merge remote-tracking branch 'origin/master' into issue509_parcours_referent 2022-03-21 12:59:24 +01:00
julienfastre c8a66f008e Merge branch 'issue502_user_in_actions' into 'master'
Issue502 referres in AccompanyingPeriodWork

See merge request Chill-Projet/chill-bundles!381
2022-03-21 11:55:24 +00:00
julienfastre b6b6c25b3b adapt queries for listing near recents evaluation and work on homepage, taking care of referrers 2022-03-21 12:54:50 +01:00
julienfastre cb35aed202 use remove-items UI api for listing referrers 2022-03-21 12:45:20 +01:00
julielenaerts eebe1d669a first commit 2022-03-21 12:39:33 +01:00
julienfastre 8f462da627 fix cs 2022-03-21 12:32:46 +01:00
julienfastre 3aaecc8630 set creator as referrer for works 2022-03-21 12:32:40 +01:00
julielenaerts 9b97b03d42 csfixes 2022-03-21 12:16:49 +01:00
julielenaerts bdb07a3a05 options added to create person or parcours and to access global history 2022-03-21 12:10:03 +01:00
julienfastre 2fda5b751b Merge remote-tracking branch 'origin/master' into issue502_user_in_actions 2022-03-21 11:53:21 +01:00
julienfastre ddb048daca Merge branch 'issue479_admin_user' into 'master'
user admin

See merge request Chill-Projet/chill-bundles!372
2022-03-21 10:47:43 +00:00
julienfastre ac42de7863 Merge branch 'fix-test-2022-03-21' 2022-03-21 11:46:48 +01:00
julienfastre 2c55cfe1dc by default, translate menu items 2022-03-21 11:41:16 +01:00
julienfastre 3ba3498892 Merge remote-tracking branch 'origin/master' into issue479_admin_user 2022-03-21 11:36:28 +01:00
julienfastre 99276dc41c fix cs 2022-03-21 11:35:50 +01:00
julienfastre fced8ef4b7 try to fix test with null id 2022-03-21 11:34:54 +01:00
julielenaerts a06a0788c1 csfixes 2022-03-21 10:22:28 +01:00
julielenaerts 5a8291dc87 merge master into branch 2022-03-21 10:21:59 +01:00
julielenaerts 15af0203ff add menu entry in section menu 2022-03-21 10:21:12 +01:00
julielenaerts 7006196691 csfixes 2022-03-21 09:54:53 +01:00
julielenaerts 5cbe14464d fix in view template to display firstname + lastname in title if it exists 2022-03-21 09:53:59 +01:00
julielenaerts 2463a492c8 merge master into branch 2022-03-21 09:40:39 +01:00
julielenaerts 72f69f0f82 changelog updated 2022-03-19 12:11:49 +01:00
julielenaerts a2daeff384 csfixes 2022-03-19 12:10:47 +01:00
julielenaerts caaa25ef8e controller action to create parcours from within household + link added in template 2022-03-19 12:08:20 +01:00
julielenaerts ff5aeaae17 translation changed in action evaluation section 2022-03-19 11:32:16 +01:00
julielenaerts 184a664bf9 english text translated in thirdparty view page 2022-03-19 11:25:56 +01:00
nobohan dbc604d84a AccompanyingCourseWorkEdit: download existing documents 2022-03-18 17:02:35 +01:00
nobohan 9c353669ea activity: fix delete button for documents 2022-03-18 16:11:09 +01:00
julienfastre 8d92cc0ba7 remove history from menus, temporarily 2022-03-18 15:40:01 +01:00
nobohan 215b859725 activity: hide delete button from asyncupload and add delete buttons from chill collection 2022-03-18 15:25:45 +01:00
julienfastre da67fa4c4f fix role for creating activity in person 2022-03-18 14:33:05 +01:00
julienfastre 5b4c3ae9b3 Merge branch 'issue503_workflow_document_template' into 'master'
Workflow document template

See merge request Chill-Projet/chill-bundles!382
2022-03-18 13:24:40 +00:00
julienfastre fdb36ab047 add document title to workflow EvaluationDocument handler 2022-03-18 14:18:47 +01:00
julienfastre a1b1e6bb17 Merge remote-tracking branch 'origin/master' into issue503_workflow_document_template 2022-03-18 14:01:43 +01:00
nobohan 73dd97f7d3 upd CHANGELOG 2022-03-18 13:58:20 +01:00
julienfastre bfd51c6615 allow downloads in LO editor 2022-03-18 13:55:33 +01:00
nobohan b84e161399 quick fix css class in acc period evaluation form, issue client 557 2022-03-18 12:35:14 +01:00
nobohan 3b8c329ff6 upd CHANGELOG 2022-03-17 19:08:13 +01:00
nobohan e7299bac4a person: add person ressource to person docgen normaliser 2022-03-17 19:07:11 +01:00
Marc Ducobu 80d518e4af Merge branch 'fixdataimportcp4digits' into 'master'
Fix pbm importing CP from France on 4 digits

See merge request Chill-Projet/chill-bundles!386
2022-03-17 17:44:39 +00:00
Marc Ducobu 730762d1c6 Merge branch 'master' into fixdataimportcp4digits 2022-03-17 18:37:00 +01:00
Marc Ducobu 288f0dbf69 Fix pbm importing CP from France on 4 digits 2022-03-17 18:34:55 +01:00
Marc Ducobu 2c02150b1a Use CS Fixer 2022-03-17 18:29:16 +01:00
nobohan 5e0a693108 commentembeddable: add a condition for the early return in normalisation 2022-03-17 17:51:25 +01:00
julielenaerts 72ba2c6bca paginator added + phpcsfixes 2022-03-17 14:13:21 +01:00
julielenaerts 6adb647ccc changelog updated 2022-03-17 12:31:44 +01:00
julielenaerts 97731b0a9b controller + template made to list confirmed parcours for a specific user 2022-03-17 12:28:00 +01:00
Marc Ducobu 1e63d00767 Fix pbm importing CP from France on 4 digits 2022-03-16 16:27:17 +01:00
julielenaerts 6151d0ce54 fix name suggestion badges underneath input fields 2022-03-16 12:32:54 +01:00
julielenaerts 387b7c2fbd first commit 2022-03-16 11:36:46 +01:00
julienfastre 1a783e1881 Merge branch 'issue495_AccPeriodWorkEval_circular_reference' into 'master'
AccompanyingPeriodWorkEvaluation: fix circular reference when serialising

See merge request Chill-Projet/chill-bundles!383
2022-03-14 20:48:37 +00:00
julienfastre d04f5a527b remove link to action on homepage, in evaluation list 2022-03-14 21:46:21 +01:00
julienfastre f51279e83e fix saving maxDate when denormalizing object 2022-03-14 21:46:01 +01:00
julienfastre 90bebbad7d fix normalization for docgen 2022-03-14 21:27:21 +01:00
nobohan 82052f5d70 AccompanyingCourseWorkEdit: fix setting title of document with a fresh upload 2022-03-14 15:13:21 +01:00
nobohan 369397bf4f upd CHANGELOG 2022-03-14 14:42:53 +01:00
julienfastre c61577edda Merge remote-tracking branch 'origin/master' into issue495_AccPeriodWorkEval_circular_reference 2022-03-14 14:42:24 +01:00
nobohan 1beae4d713 AccompanyingCourseWorkEdit: download existing documents 2022-03-14 14:42:04 +01:00
julielenaerts 352302b7aa merge master into branch 2022-03-14 13:51:43 +01:00
julienfastre 01b60f334a Merge remote-tracking branch 'origin/master' into issue491_thirdparty_edit_modal 2022-03-14 13:43:39 +01:00
julielenaerts 0546a43d63 changelog updated 2022-03-14 13:41:32 +01:00
julienfastre 5c68879509 fix doctrine annotation to make it comply with cs 2022-03-14 13:41:11 +01:00
julienfastre 9d844f6692 Merge branch 'issue505_create_household_composition' into 'master'
Issue505 create household composition

See merge request Chill-Projet/chill-bundles!378
2022-03-14 12:40:15 +00:00
julienfastre 28509f651d fix button and acl in household composition list 2022-03-14 13:39:33 +01:00
julienfastre b590444375 Merge remote-tracking branch 'origin/master' into issue505_create_household_composition 2022-03-14 13:35:43 +01:00
julienfastre 873258fc84 update button person ressource creation 2022-03-14 13:35:03 +01:00
julienfastre 7988becc45 Merge branch 'issue504_person_ressource_create' into 'master'
Separate create page person resource

See merge request Chill-Projet/chill-bundles!377
2022-03-14 12:33:42 +00:00
julienfastre 45c4a7ae64 Merge remote-tracking branch 'origin/master' into issue504_person_ressource_create 2022-03-14 13:30:32 +01:00
julienfastre 05803787a9 Merge branch 'issue493_order_parcours' into 'master'
Issue493 order parcours

See merge request Chill-Projet/chill-bundles!375
2022-03-14 12:28:33 +00:00
julienfastre 33acc645ea Merge remote-tracking branch 'origin/master' into issue493_order_parcours 2022-03-14 13:27:26 +01:00
julienfastre 0ce787701f Merge branch 'fix_blur_toggle' into 'master'
finding solution for toggle button position

See merge request Chill-Projet/chill-bundles!374
2022-03-14 12:26:25 +00:00
julienfastre e9cacbb74a add comment for future refactorisation 2022-03-14 13:26:07 +01:00
julienfastre a2f8f7ae43 add badge on third party in residential address list 2022-03-14 13:18:41 +01:00
julienfastre a49c53772e Merge remote-tracking branch 'origin/master' into fix_blur_toggle 2022-03-14 13:15:05 +01:00
julienfastre 1adccdb06e Merge branch 'issue489_address_onTheFly' into 'master'
Address history onTheFly for linked person

See merge request Chill-Projet/chill-bundles!373
2022-03-14 12:14:08 +00:00
julienfastre 22d593fc12 Merge remote-tracking branch 'origin/master' into issue489_address_onTheFly 2022-03-14 13:12:53 +01:00
julienfastre de7ec6fa54 Merge branch 'issue477_autosave_comment_parcours' into 'master'
Issue477 autosave comment parcours

See merge request Chill-Projet/chill-bundles!370
2022-03-14 12:12:07 +00:00
julienfastre 90948e5513 Merge remote-tracking branch 'origin/master' into issue477_autosave_comment_parcours 2022-03-14 13:11:53 +01:00
julienfastre bd79391efc fix autosave of comment 2022-03-14 13:04:29 +01:00
julielenaerts 4ea72f7d9d csfixes 2022-03-14 11:49:58 +01:00
julielenaerts 96e38a8a6d eventlistener added to capitalize names correctly 2022-03-14 11:49:01 +01:00
julielenaerts 09e6872724 firstname added to onthefly for child or contact 2022-03-14 11:48:39 +01:00
julielenaerts f44f9d356b migration adjusted to have actual empty string instead of '' 2022-03-14 11:16:58 +01:00
nobohan 9f0ab5aee7 upd CHANGELOG 2022-03-14 10:43:28 +01:00
nobohan 6eac6044cd AccompanyingCourseWorkEdit: replace document by a new one (working now) 2022-03-14 10:42:16 +01:00
julielenaerts a24cd693e3 firstname field added to twig form for child or contact types 2022-03-14 10:23:47 +01:00
julienfastre f63aab327d Merge branch 'issue480_bug_householdrenderbox' into 'master'
bugfix when position of member is null

See merge request Chill-Projet/chill-bundles!365
2022-03-14 08:58:52 +00:00
julienfastre 0c9499dd58 Merge remote-tracking branch 'origin/master' into issue480_bug_householdrenderbox 2022-03-14 09:53:23 +01:00
julielenaerts 00787adf2b firstname property added to thirdparty + canonicalize function adapted 2022-03-14 09:35:22 +01:00
nobohan dbe186547f AccompanyingCourseWorkEdit: replace document by a new one 2022-03-13 22:31:26 +01:00
nobohan 13f0b8610c quick fix: missing translation in Task 2022-03-11 16:37:26 +01:00
nobohan f9e8bf4f2d upd CHANGELOG 2022-03-11 10:22:09 +01:00
nobohan 44e93dd5f8 AccompanyingPeriodWorkEvaluation: fix circular reference when serialising 2022-03-11 10:20:42 +01:00
nobohan ee8f331de4 Revert "AccompanyingPeriodWorkEvaluation: fix circular reference when serialising"
This reverts commit 99f8aeb6cd.
2022-03-11 10:18:14 +01:00
nobohan 99f8aeb6cd AccompanyingPeriodWorkEvaluation: fix circular reference when serialising 2022-03-11 10:01:20 +01:00
nobohan fc1fe7c277 php cs fix 2022-03-10 18:14:57 +01:00
nobohan a8b6609dbf comment in accompanying course: add loader + fix when resetting to empty string 2022-03-10 18:12:42 +01:00
nobohan ded2ac7d48 accompanyiing period comment: fix removing of comment 2022-03-10 17:01:52 +01:00
nobohan 16a0dc4621 fix role for AccPeriod Comment API 2022-03-10 16:46:10 +01:00
nobohan ba668d3b9d upd CHANGELOG 2022-03-10 16:27:03 +01:00
nobohan 690a443bdb fix code style for AccompanyingPeriodWork - referrers 2022-03-10 16:25:05 +01:00
nobohan 137eb184d0 accompanying period work: display referrers in the list of work 2022-03-10 16:18:59 +01:00
julielenaerts 0a2730540e lost text removed plus condition to editing file uncommented 2022-03-10 14:45:43 +01:00
julielenaerts 9284a4bc29 ACL added and buttons to download and edit document 2022-03-10 14:30:19 +01:00
nobohan f2edc1ef0c set constrint ondelete for comment in AccompanyingPeriod 2022-03-10 14:23:00 +01:00
julielenaerts bf2d9acc5a correction of template, display title linked to workflow doc 2022-03-10 14:03:37 +01:00
julielenaerts 2628e58ea0 document title added + concerned users 2022-03-10 12:28:17 +01:00
nobohan da650fa1f2 AccompanyingPeriodWork: add doctrine event listener to add logged user to referrers collection 2022-03-10 10:53:40 +01:00
nobohan 55a65ee6e9 accompanyingPeriodWork: add referrer in vuejs form 2022-03-10 10:32:20 +01:00
nobohan 492c22d1b7 AccompanyingPeriodWork: add referrers field 2022-03-10 08:40:11 +01:00
julielenaerts e153fa34e9 merge master into branch 2022-03-09 20:48:30 +01:00
julielenaerts d272e1398c fix merge conflict in changelog 2022-03-09 20:45:42 +01:00
julielenaerts 9457926a35 fix merge conflict 2022-03-09 20:43:31 +01:00
julielenaerts 8ff80ac65e changelog updated 2022-03-09 20:42:48 +01:00
julielenaerts 3d1ded8b1c position of toggle button improved (differentation between twig and vue) + fix fa-eye-slash in vue component 2022-03-09 20:41:24 +01:00
julielenaerts c611f35cd6 finding solution for toggle button position 2022-03-09 20:41:24 +01:00
julielenaerts f79cfda74a update changelog 2022-03-09 20:31:02 +01:00
julielenaerts ff4b90835e show current civility and profession in edit form + fix saving of edited information 2022-03-09 20:29:38 +01:00
julielenaerts d5501bcfbd remove console logs to avoid mess in the console 2022-03-09 20:07:41 +01:00
julielenaerts fb1552f6b7 update changelog and csfixes 2022-03-09 14:07:41 +01:00
julielenaerts e28da7e99b create-edit composition placed in separate page to avoid confusion 2022-03-09 14:06:18 +01:00
julielenaerts 4b899d337a changelog updated 2022-03-09 13:36:26 +01:00
julielenaerts d6933fce35 add contact button color changed 2022-03-09 13:35:55 +01:00
julielenaerts aefd09693b position of toggle button improved (differentation between twig and vue) + fix fa-eye-slash in vue component 2022-03-09 12:10:33 +01:00
julielenaerts 8555277827 changelog updated 2022-03-09 11:06:10 +01:00
julielenaerts 6f58a9a8bb separate create page 2022-03-09 11:06:00 +01:00
julielenaerts b02739cc3c phonenumber placeholder removed 2022-03-09 09:35:47 +01:00
julielenaerts b8d9d59d76 condition added to display thirdparty centers or not 2022-03-09 09:19:29 +01:00
nobohan ba52e95253 display error messages above form when creating new Location 2022-03-08 17:21:49 +01:00
nobohan 2e69dbb7c9 upd CHANGELOG 2022-03-08 17:06:58 +01:00
julienfastre 13d579dc33 add 'for' in macro workflow breadcrumb 2022-03-08 17:06:30 +01:00
nobohan efcc602d53 Activity form: add required class name on required field built with vue 2022-03-08 16:09:22 +01:00
julielenaerts ee82bd2867 change personne to usager and & to ET 2022-03-08 16:03:59 +01:00
nobohan fcc5d3d349 Activity: small fixes on displaying social Issues and social Actions hidden fields 2022-03-08 15:41:03 +01:00
julienfastre af3b761208 evaluationWorkDocument: fill title with document is generated 2022-03-08 14:41:25 +01:00
julienfastre 23e61ac6a7 fixes stan errors 2022-03-08 11:43:47 +01:00
julienfastre e4ae495a3f add empty lines on addresses when address is empty 2022-03-08 11:43:47 +01:00
julienfastre ec99bc95fa add itemMeta variable for course list 2022-03-08 11:43:47 +01:00
nobohan b68b43118b update CHANGELOG 2022-03-08 11:38:40 +01:00
nobohan db95e935d9 order accompanying period by opening date in search person 2022-03-08 11:37:08 +01:00
nobohan dc5ff53a57 order accompanying course by openingDate for Household 2022-03-08 11:21:59 +01:00
nobohan 50a2de1559 order accompanying course by openingDate for Person 2022-03-08 11:20:06 +01:00
julielenaerts d18ab5cf49 fix display of email in person renderbox if null or empty string 2022-03-08 11:00:31 +01:00
julielenaerts 1860478aea finding solution for toggle button position 2022-03-08 09:48:17 +01:00
nobohan 17e83deb55 User admin: put pagination 2022-03-08 09:46:41 +01:00
julielenaerts 388b666b5d person badge changed to include onTheFly + changelog updated 2022-03-07 14:36:44 +01:00
nobohan 9b06ccc3e6 user admin: use flex-table and flex-bloc in twig 2022-03-07 11:13:11 +01:00
julienfastre efbd9b0185 do not allow to remove doc or evaluations if workflow is associated 2022-03-07 00:30:53 +01:00
julienfastre b2a61071bf create voter which blocks deletion if a workflow exists 2022-03-07 00:30:53 +01:00
julienfastre 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
julienfastre c7f2eedd4b Merge remote-tracking branch 'origin/master' into issue484_link_household 2022-03-06 22:57:12 +01:00
julienfastre 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
julienfastre f88d0ee19e Merge remote-tracking branch 'origin/master' into issue478_remove_localisation 2022-03-06 22:54:48 +01:00
julienfastre 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
julienfastre af79ffd544 Merge remote-tracking branch 'origin/master' into issue472_filter_job_user_in_set_referrer 2022-03-06 22:40:14 +01:00
julienfastre 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
julienfastre 7afada5dad fix cs 2022-03-06 22:36:38 +01:00
julienfastre 739c7e9a77 Merge remote-tracking branch 'origin/master' into url_in_accompanyingPeriodWork_evaluations 2022-03-06 22:33:16 +01:00
julienfastre 03471a74fe fix creating alt phonenumber 2022-03-06 22:28:33 +01:00
julienfastre 44ed2e44e0 another way to fix phonenumber and telephone in third party / OnTheFly 2022-03-06 22:16:48 +01:00
julielenaerts 3352999862 rebase onto master 2022-03-04 17:23:37 +01:00
julielenaerts 5605813826 Update changelog 2022-03-04 17:22:27 +01:00
julielenaerts 72795240b9 Add current household link in person banner 2022-03-04 17:22:06 +01:00
julielenaerts d0772fc306 Add email to twig personRenderBox 2022-03-04 17:08:41 +01:00
nobohan def90893de upd CHANGELOG 2022-03-04 15:12:11 +01:00
nobohan 4b692edd7d accompanying course comment: autosave the comment 2022-03-04 15:09:50 +01:00
nobohan 6472c554ed accompanying course comment: more tentative to delete the comment 2022-03-04 14:22:25 +01:00
nobohan f04118218d accompanying course comment: tentative to delete the comment 2022-03-04 13:56:03 +01:00
nobohan cde6e8f368 accompanying course: allow PATCH on a comment entity 2022-03-04 13:01:01 +01:00
nobohan 6d46efa610 accompanying course: fix posting of pinned comment 2022-03-04 11:53:27 +01:00
nobohan 84f2e1c72a Accompanying Period: set cascade persist on pinnedComment 2022-03-04 10:34:47 +01:00
nobohan 1c1dec1f5b upd CHANGELOG 2022-03-04 08:46:32 +01:00
nobohan 3ff9291580 assign User to undsipatched acc period: filter users by job type 2022-03-04 08:46:32 +01:00
julielenaerts 9265a15427 Update changelog 2022-03-03 21:12:00 +01:00
julielenaerts 6d3b88aee9 Add current household link in person banner 2022-03-03 21:09:50 +01:00
julielenaerts 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
julielenaerts 892be42580 update changelog 2022-03-03 16:28:31 +01:00
julienfastre e9236875d2 quick fix for phonenumber alt on person 2022-03-03 15:44:30 +01:00
julienfastre 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
julienfastre 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
julienfastre 9769aa1386 fix loading of residential address form type 2022-03-03 15:07:45 +01:00
julienfastre bf4a3a2c91 add id to docgen normalization fo a person 2022-03-03 15:01:14 +01:00
julienfastre 3df2335cf4 Merge remote-tracking branch 'origin/master' into issue464_document_on_person 2022-03-03 14:42:06 +01:00
julienfastre 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
julienfastre 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
julielenaerts 34b3c6fa32 bugfix when position of member is null 2022-03-03 14:15:20 +01:00
julienfastre b1c0e18e51 Merge remote-tracking branch 'origin/master' into issue470_location_in_activity_validation 2022-03-03 13:59:44 +01:00
julienfastre 6edf0bcb3b fix delete links in documents 2022-03-03 13:57:00 +01:00
julienfastre 6171b3411f fix creation of document when overriding center resolver 2022-03-03 13:07:36 +01:00
julienfastre 86bf0115dd fix condition when empty phonenumber 2022-03-03 13:05:01 +01:00
julienfastre 19cad9a7a4 do not update names after person update 2022-03-03 12:43:04 +01:00
julienfastre a736c2a67e fix migrations 2022-03-03 12:32:38 +01:00
julienfastre 636f92b168 Revert "add migrations files"
This reverts commit 7f5a91fc49.
2022-03-03 12:10:25 +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
julienfastre 7f5a91fc49 add migrations files 2022-03-03 11:42:43 +01:00
julienfastre 3ab71c8a2e update chill-app with migrations for budget 2022-03-03 11:12:30 +01:00
julienfastre fdf1911c15 fix default config 2022-03-03 11:07:02 +01:00
julienfastre ba24abf788 fix cs 2022-03-03 10:56:36 +01:00
julienfastre 076728bf5f enable chilld budget bundle in test app 2022-03-03 10:55:25 +01:00
julienfastre 0833bb49ca fixes for budgets 2022-03-03 10:37:10 +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
julienfastre ac12e75714 Merge remote-tracking branch 'origin/master' into issue469_budget 2022-03-02 22:01:28 +01:00
julienfastre 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
julienfastre fccac80222 Merge remote-tracking branch 'origin/master' into issue439_residential_address_otf 2022-03-02 21:53:17 +01:00
julienfastre bf70d344bf remove missing error on phpstan 2022-03-02 21:45:14 +01:00
julienfastre 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
julienfastre 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
julienfastre 09ca1ec6bb fix phstan error 2022-03-02 21:23:05 +01:00
julienfastre 970431197f display phonenumber in tel link 2022-03-02 21:19:44 +01:00
julienfastre 9fdd9da486 display phonenumber and mobilenumber in search results 2022-03-02 21:10:37 +01:00
julienfastre b9eee51de6 fix cs 2022-03-02 21:02:58 +01:00
julienfastre c0ec64e4be add leadiing country code while seraching numbers 2022-03-02 21:02:32 +01:00
julielenaerts 74a84e42a6 update changelog and csfixes 2022-03-02 19:24:33 +01:00
julielenaerts 595ddf5b6f fix display of thirdparty contact badges in twig template 2022-03-02 19:20:26 +01:00
julielenaerts abe183fd10 fix position of toggle button
so it doesn't cover content or falls outside box
2022-03-02 19:11:34 +01:00
julielenaerts 9a0883eb5f Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-02 18:08:16 +01:00
julielenaerts 663295d436 fix edit name of thirdparty 2022-03-02 18:07:55 +01:00
Mathieu Jaumotte 9f9986d367 Merge branch 'issue475_bug_graphique' 2022-03-02 17:38:20 +01:00
Mathieu Jaumotte db37527f72 try to resolve bug with flot-button.bottom placement (2) 2022-03-02 17:36:24 +01:00
julienfastre 6171a221b2 fix cs 2022-03-02 16:59:20 +01:00
julienfastre 1312fd0941 allow psalm to fail 2022-03-02 16:41:53 +01:00
julienfastre c1832d39f1 remove fixed phpstan issue 2022-03-02 16:40:50 +01:00
julienfastre 3756631595 fix some psalm issues 2022-03-02 16:39:36 +01:00
julielenaerts 969f0b8aeb Display of budget result 2022-03-02 16:38:55 +01:00
julielenaerts 8b37f008e6 csfixes 2022-03-02 16:38:31 +01:00
julienfastre a7a933c7a7 fix test for phonenumber update: desactivate temporarily 2022-03-02 16:32:28 +01:00
julienfastre 15bc3e62d3 fix cs 2022-03-02 16:29:21 +01:00
julienfastre 5ce62f5458 phonenumber helper: remove unused method and fix tests 2022-03-02 16:27:55 +01:00
julielenaerts 283b378291 fix template bug 2022-03-02 16:19:17 +01:00
julienfastre 3e30684198 normalization on 3party phone 2022-03-02 16:19:02 +01:00
julienfastre c2e284682f phonenumber on 3party: twig stuffs 2022-03-02 16:13:17 +01:00
julienfastre 5407dbfc98 form for third party telephone 2022-03-02 16:05:08 +01:00
julienfastre fa23bfd7d5 fix upgrade formula for phonenumber 2022-03-02 16:02:23 +01:00
julienfastre 09de7cbf7d allow null values on phonenumber in location and person 2022-03-02 15:53:39 +01:00
julienfastre 6a3c8017f0 upgrade phonenumber on 3party: migrations 2022-03-02 15:50:01 +01:00
julielenaerts 9bb149fb02 added missing translations + further adjustment templates 2022-03-02 15:44:49 +01:00
julienfastre eb6ec8a4af apply phonenumber on locations 2022-03-02 15:08:16 +01:00
julienfastre c8c2c4c859 phonenumber type for form 2022-03-02 15:01:04 +01:00
julienfastre 7bd93e53c2 fix formatting upgrade clause 2022-03-02 14:23:50 +01:00
julienfastre 5d6f3de694 normalize phonenumber in person docgen normalizer 2022-03-02 14:22:12 +01:00
julienfastre 3eb826d422 default value for Phonenumbers 2022-03-02 14:21:53 +01:00
julienfastre e9ffdb1f03 fix cs 2022-03-02 14:11:47 +01:00
julienfastre f4f488dad1 normalization of phonenumber 2022-03-02 14:10:48 +01:00
julienfastre 2a9f1dc238 restore templating class 2022-03-02 13:51:19 +01:00
julienfastre 8482c8ffa7 update app 2022-03-02 13:50:35 +01:00
julienfastre 54ad7a4b8f restore showing phonenumber 2022-03-02 13:48:48 +01:00
julienfastre ed4cf67e79 set carrier code parameter and lint existing phonenmubers 2022-03-02 13:01:01 +01:00
Mathieu Jaumotte 550168fd7c Merge branch 'issue475_bug_graphique' 2022-03-02 13:00:51 +01:00
Mathieu Jaumotte 8470430c57 try to resolve bug with flot-button.bottom placement 2022-03-02 13:00:23 +01:00
julielenaerts 5dc117037d change label styling for view of resource/charge (suggestion) 2022-03-02 12:02:49 +01:00
julielenaerts 7f1083aa40 Use select2 field 2022-03-02 12:02:16 +01:00
julielenaerts 900adc7105 improvements templates 2022-03-02 11:44:10 +01:00
julielenaerts 0648154ba1 remove comments 2022-03-02 11:43:55 +01:00
julielenaerts 86de8137e4 restyling layout of table 2022-03-02 11:42:54 +01:00
Mathieu Jaumotte a9415488dd Merge branch 'list_documents_page' 2022-03-02 09:55:16 +01:00
Mathieu Jaumotte 8945703785 fix template mistakes 2022-03-02 09:53:51 +01:00
julienfastre 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
Mathieu Jaumotte 7b17dc692e Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-03-01 16:14:00 +01:00
Mathieu Jaumotte e5f7120733 Merge branch 'list_documents_page' 2022-03-01 16:13:20 +01:00
Mathieu Jaumotte 1a05ffab96 fix flex item-col placement for documents list 2022-03-01 16:13:11 +01:00
Mathieu Jaumotte aad7a21bc3 Merge branch 'list_documents_page' 2022-03-01 16:09:10 +01:00
Mathieu Jaumotte ae0bf7bfd7 fix flex item-col placement for documents list 2022-03-01 16:08:52 +01:00
julienfastre 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
julienfastre 22aefca5c9 Merge remote-tracking branch 'origin/issue442_toggle_emergency' into issue442_toggle_emergency 2022-03-01 15:58:20 +01:00
julienfastre 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
julielenaerts cefa304fb5 mixup colors fixed. color of resource to be discusses still 2022-03-01 15:49:37 +01:00
nobohan a187bac7b0 DocGeneratorTemplateController: fix in case there is no public form 2022-03-01 15:48:32 +01:00
julielenaerts 83760cc980 Merge remote-tracking branch 'origin/master' into issue469_budget 2022-03-01 15:42:59 +01:00
julielenaerts 2b108d0d70 update changelog 2022-03-01 15:32:47 +01:00
julielenaerts 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
Mathieu Jaumotte 4536f30da2 Merge branch 'list_documents_page' 2022-03-01 15:11:01 +01:00
Mathieu Jaumotte 8764aacd92 fix confusion between document dates 2022-03-01 15:03:21 +01:00
julienfastre 8b8f6027cc Merge remote-tracking branch 'origin/master' into issue442_toggle_emergency 2022-03-01 14:52:56 +01:00
julielenaerts 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
julielenaerts 695b9d5bea merge with master 2022-03-01 14:32:03 +01:00
julielenaerts f38cfb4b28 adjustments templates 2022-03-01 14:30:12 +01:00
nobohan a7240e8cc6 PersonJsonNormalizer: fix circular reference with residential address 2022-03-01 14:15:39 +01:00
julielenaerts 67948f7f3a styles in scss with webpack 2022-03-01 14:00:14 +01:00
Mathieu Jaumotte 52d8776fbb Merge branch 'list_documents_page' 2022-03-01 11:34:07 +01:00
Mathieu Jaumotte 0d38cae217 fix macro metadata + fix merge conflicts from branch ux_corrections 2022-03-01 11:33:33 +01:00
julielenaerts d6bad9e030 reorganization of templates 2022-03-01 11:07:53 +01:00
Pol Dellaiera b146f17d2f Update twig function isEditable. 2022-03-01 09:58:57 +01:00
julienfastre 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
julienfastre ecc2e390f7 Merge remote-tracking branch 'origin/master' into issue463 2022-03-01 09:48:19 +01:00
julienfastre 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
julienfastre 449a6a1b4e Merge remote-tracking branch 'origin/master' into issue458_ChillCollectionType 2022-03-01 09:28:44 +01:00
julienfastre 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
julielenaerts 3b26466a6c remove duplicate key in thirdparty serializer 2022-02-28 20:07:13 +01:00
julielenaerts a6ac6ee6d8 fix merge conflicts 2022-02-28 19:47:22 +01:00
julielenaerts a59994355b fix merge conflict 2022-02-28 17:14:37 +01:00
julienfastre 06c279627a Merge remote-tracking branch 'origin/master' into workflow/fixes-2022-02 2022-02-28 16:29:57 +01:00
julienfastre 1e146f542e try to fix some things 2022-02-28 16:09:52 +01:00
julienfastre 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
Mathieu Jaumotte 260ce8ba17 issue 463: add delete button on draft periods page 2022-02-28 14:47:35 +01:00
julienfastre 822f0aa737 fix cs 2022-02-28 14:38:25 +01:00
julienfastre e10a6b4bf2 Merge branch 'issue441_enfant_confie' 2022-02-28 14:37:38 +01:00
julienfastre 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
julienfastre 31ec6c70ef fix cs 2022-02-28 14:27:31 +01:00
Mathieu Jaumotte cd84700400 Merge branch 'ux_corrections' 2022-02-28 14:23:54 +01:00
julienfastre 08fa1edbee Merge remote-tracking branch 'origin/master' into issue345_internal_thirdparty_contact 2022-02-28 14:22:52 +01:00
Mathieu Jaumotte 15d9593d0f design correction on list documents page 2022-02-28 14:22:15 +01:00
julienfastre 010afded18 order civilities 2022-02-28 13:56:52 +01:00
julienfastre c12f633829 fixes 2022-02-28 13:52:41 +01:00
julielenaerts fb6f0c316e update changelog 2022-02-28 12:22:17 +01:00
julielenaerts b1ed263c4e add email in personrenderbox 2022-02-28 12:18:58 +01:00
julielenaerts 846e487e27 fix display of address in renderbox 2022-02-28 12:13:58 +01:00
julielenaerts 72a9183ca8 fix in case of no profession 2022-02-28 12:04:05 +01:00
julienfastre fe89704672 Merge remote-tracking branch 'origin/master' into issue345_internal_thirdparty_contact 2022-02-28 11:39:16 +01:00
julienfastre 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
julienfastre 8bf179934d update psalm to ignore new error (sorry) 2022-02-28 11:37:03 +01:00
julielenaerts 24c79cc4b1 fix merge conflicts 2022-02-28 10:20:29 +01:00
julienfastre f93282d657 fix cs 2022-02-28 10:13:00 +01:00
julielenaerts 18c0e6a6bf template adjustments for household members 2022-02-28 10:12:40 +01:00
julienfastre 3a602385cc Merge remote-tracking branch 'origin/master' into issue388_order_social_issues 2022-02-28 09:51:40 +01:00
julielenaerts 26373e5d23 template adjustments for household members 2022-02-28 09:47:47 +01:00
julienfastre cb4c3b46b9 fix creating two workflow on accompanying period work 2022-02-27 03:03:29 +01:00
julienfastre abb81bf45f remove console log 2022-02-27 02:44:01 +01:00
julienfastre 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
julielenaerts deadeb341e more template adjustments 2022-02-25 17:45:50 +01:00
julielenaerts 274c6115cc index templates fixed for display of past and future budgets 2022-02-25 17:01:24 +01:00
julielenaerts 416665f209 translations added 2022-02-25 17:01:04 +01:00
julielenaerts f60f927549 Fix budget voter for use with household 2022-02-25 16:40:27 +01:00
julielenaerts 2e59c1415b csfixes plus changelog updated 2022-02-25 16:24:25 +01:00
julielenaerts d852477c51 Add budget of household members to overview page of household budget 2022-02-25 16:20:52 +01:00
julielenaerts f8d5f13a88 add methods to get budgetResources and budgetCharges in person entity 2022-02-25 16:20:07 +01:00
julienfastre af0d7765ff fixes for adding evaluation document 2022-02-25 16:13:31 +01:00
julienfastre c1f5730c4d Merge remote-tracking branch 'origin/issue466_file_upload' into workflow/fixes-2022-02 2022-02-25 15:40:38 +01:00
julienfastre 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
julienfastre 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
julienfastre 432cce280b simplify showing title of workflow, and add handler for evaluationDocument 2022-02-25 14:02:36 +01:00
julielenaerts 530297bc67 csfixes 2022-02-25 13:59:05 +01:00
julielenaerts c416f1ef6d fix bug to resolve onthefly component within thirdparty renderbox 2022-02-25 13:58:17 +01:00
julielenaerts 3a5e956e49 updated changelog 2022-02-25 13:20:46 +01:00
julielenaerts 5cf4013a99 cs fixes 2022-02-25 13:12:25 +01:00
julielenaerts 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
julienfastre bf25740098 list for workflows: previous and old workflows 2022-02-25 12:43:04 +01:00
julienfastre 18836f312a fix cs 2022-02-25 12:11:05 +01:00
julienfastre 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
julienfastre 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
julielenaerts fc5a893b00 template fixes and controller fixes for household budget 2022-02-25 10:30:37 +01:00
julielenaerts 92a6fed521 phpstan fixes 2022-02-25 09:48:33 +01:00
julielenaerts 051ed19f97 cs-fixes 2022-02-25 09:29:28 +01:00
julienfastre 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
julielenaerts c4e0b68ebe change block personcontent to content more consistent with other templates and less need for if-statements 2022-02-24 15:59:13 +01:00
julielenaerts f8ec0f85e5 property household added to entity 2022-02-24 15:49:47 +01:00
julielenaerts ed33514aee Voter adapted for use within vendee 2022-02-24 15:49:28 +01:00
julielenaerts 0d96c1f12d Repositories adapted for use with person or household 2022-02-24 15:49:04 +01:00
julielenaerts 0fcf21bd35 Controllers adjusted for use with person or household 2022-02-24 15:48:39 +01:00
julielenaerts 9065ec40b1 Menu entry added household menu 2022-02-24 15:47:58 +01:00
julielenaerts 8f6ab15621 migrations 2022-02-24 15:46:22 +01:00
julielenaerts fd69ae3d4a Translation folder renamed to translation in accordance to other bundles 2022-02-24 15:46:08 +01:00
julielenaerts 81b42ef99a templates adjusted to allow use for person and household 2022-02-24 15:45:35 +01:00
julielenaerts c546d23421 scss file added plus config webpack
still missing something, because doesn't work yet
2022-02-24 15:44:37 +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
julienfastre 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
julienfastre 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
julienfastre 08f9819453 add accessKey to entity workflow step 2022-02-23 18:33:29 +01:00
julielenaerts 7067d4b5bd Attempt to make voter work 2022-02-23 18:07:54 +01:00
julielenaerts de0be15fff Added budget link to household menu + created controller file
no content for controller yet
2022-02-23 18:07:38 +01:00
julienfastre 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
julielenaerts fd16222c51 translations folder moved 2022-02-23 17:20:19 +01:00
julielenaerts 185d1dbf49 Styling view page 2022-02-23 17:16:26 +01:00
julielenaerts 576f46f845 styling of index page
style needs to be moved to correct file and changed scss
2022-02-23 15:58:06 +01:00
nobohan 154f976762 DocStore bundle: create a vue component for uploading document 2022-02-23 15:46:21 +01:00
julielenaerts d5477e94b1 fix merge conflicts 2022-02-23 14:55:43 +01:00
julielenaerts 67ae506bb5 Testing to see what still works, minor changes 2022-02-23 14:53:37 +01:00
julielenaerts 5a514cf2db Moving migration folder and adding migration 2022-02-23 14:53:01 +01:00
julielenaerts 1fdc994c0a adding budget to person menu 2022-02-23 14:52:37 +01:00
julielenaerts 35aa05fb97 change namespaces, removing AMLI 2022-02-23 14:52:04 +01:00
julielenaerts 70c7b1385e change namespaces, removing AMLI 2022-02-23 11:24:24 +01:00
julielenaerts d486f2ddfc fix styling of confidential toggle button in renderboxes 2022-02-23 10:46:25 +01:00
julielenaerts 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
julielenaerts 0601fa0142 changelog updated 2022-02-23 10:24:24 +01:00
julielenaerts 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
julienfastre ffe4dd4a98 add delete feature for entityWorkflow (wip) 2022-02-23 10:08:11 +01:00
julielenaerts cc4dfdb042 style adjustment 2022-02-22 15:24:14 +01:00
julielenaerts fd0ca3b29d style adjustment + if contact display qualité 2022-02-22 15:18:38 +01:00
julielenaerts daab42109b style adjustment 2022-02-22 15:07:40 +01:00
julielenaerts ab5bb3963b Add qualité in personsuggestion 2022-02-22 15:06:31 +01:00
julielenaerts 262bb13b6c Adding fonction in personrenderbox 2022-02-22 15:05:43 +01:00
julielenaerts 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
julienfastre 8f597eb254 update changelog 2022-02-21 17:40:09 +01:00
julienfastre 775d223be2 fix cs 2022-02-21 17:30:33 +01:00
julienfastre 3849776511 Merge remote-tracking branch 'origin/master' into kill_small_issues 2022-02-21 17:29:37 +01:00
julienfastre cb3301bcef Merge remote-tracking branch 'origin/master' into thirdparty/redirect-to-parent-when-child-is-viewed 2022-02-21 17:27:20 +01:00
julienfastre 8d74566eac update changelog 2022-02-21 17:20:15 +01:00
julienfastre 4a03c2aa43 Merge remote-tracking branch 'origin/master' into issue447_pickCivilityType 2022-02-21 17:19:21 +01:00
julielenaerts 292d56cfbe email added to person renderbox 2022-02-21 16:38:55 +01:00
julielenaerts 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
julienfastre 0a2e2301a9 document ThirdParty type and categories [ci-skip] 2022-02-21 15:25:46 +01:00
julielenaerts 874c90e0e0 start to display profession/fonction of thirdparty 2022-02-21 14:30:30 +01:00
julienfastre 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
julienfastre 213da59b0b fix test failing due to microseconds difference 2022-02-21 13:22:35 +01:00
julienfastre 4e9879ba92 update changelog 2022-02-21 12:49:19 +01:00
julienfastre 0690704391 Merge remote-tracking branch 'origin/master' into course_add_event_on_person_move 2022-02-21 12:46:10 +01:00
julienfastre 610b861345 fix test on PersonAddressMoveEvent::personChangeAddress 2022-02-21 12:44:43 +01:00
julienfastre b7f8ba4385 fix cs 2022-02-21 00:52:40 +01:00
julienfastre a923a1f135 update changelog [ci-skip] 2022-02-21 00:41:50 +01:00
julienfastre 0d804dd817 3party: redirect to parent when child is opened in view mode 2022-02-21 00:39:02 +01:00
julienfastre 4f4b1bfbaa PersonAddressMove: fix tests, address history on household, and household::getMembersOnRange 2022-02-21 00:12:57 +01:00
julienfastre caa63ea97a PersonAddressMoveEvent on household move (wip) 2022-02-19 14:04:51 +01:00
julienfastre 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
julienfastre 104af6d9b5 allow null value in end date in location history 2022-02-19 09:43:20 +01:00
julienfastre 2f2d4493ae Merge remote-tracking branch 'origin/master' into course_add_event_on_person_move 2022-02-19 09:31:00 +01:00
julielenaerts 2d23068354 start to display profession/fonction of thirdparty 2022-02-18 17:07:53 +01:00
julielenaerts 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
julielenaerts 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
julielenaerts 4920c8b28b Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-02-18 15:59:54 +01:00
julielenaerts 4f9acf3174 use correct translatorInterface instead of deprecated one 2022-02-18 15:59:36 +01:00
julielenaerts 962957409b use correct translatorInterface instead of deprecated one 2022-02-18 15:51:52 +01:00
julielenaerts 0b4d79fd5e display only last three actions in parcours resume 2022-02-18 15:51:00 +01:00
julielenaerts 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
julielenaerts 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
julienfastre 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
julienfastre 1fda56b5f7 Merge remote-tracking branch 'origin/master' into workflow/fix-sending-notifications 2022-02-17 23:34:20 +01:00
julienfastre 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
julienfastre c90e6231f9 Merge remote-tracking branch 'origin/master' into issue434_endDate_enfantHorsMenage 2022-02-17 23:31:14 +01:00
julienfastre 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
julienfastre ebea4b7008 Merge remote-tracking branch 'origin/master' into issue434_endDate_enfantHorsMenage 2022-02-17 23:25:07 +01:00
julienfastre 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
julienfastre 05f83bf566 Merge remote-tracking branch 'origin/master' into issue448_search_3rd_party 2022-02-17 23:16:41 +01:00
julienfastre 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
julienfastre fe35a29fb8 homepage vue / my workflow: replace "document" by object type 2022-02-17 23:12:14 +01:00
julienfastre 53d51fea2f Merge remote-tracking branch 'origin/master' into issue422_and_others_on_AddPersons 2022-02-17 22:51:52 +01:00
julienfastre 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
julienfastre 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
julienfastre a9aeea234c Merge remote-tracking branch 'origin/master' into issue415_filter_suggested_entities_by_close_participations 2022-02-17 21:45:43 +01:00
julienfastre 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
julienfastre e4aac56f2d Merge remote-tracking branch 'origin/master' into issue415_filter_suggested_entities_by_close_participations 2022-02-17 21:35:18 +01:00
julienfastre 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
julienfastre 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
julienfastre f86c0353a2 Merge remote-tracking branch 'origin/master' into issue465_display_person_resources 2022-02-17 21:17:40 +01:00
julienfastre 0a289e1edd Merge remote-tracking branch 'origin/master' into issue476_activity_fix_concerned_group 2022-02-17 21:11:45 +01:00
julienfastre c2c5bec0e5 in period notification, handle case when period referrer is null 2022-02-17 21:08:55 +01:00
julienfastre 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
julielenaerts 5ff47050ff replace deprecated TranslatorInterface by new one 2022-02-17 17:20:47 +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
julielenaerts 56923aa1b8 use statement added to fix CI 2022-02-17 10:04:56 +01:00
julielenaerts 62f54a3c27 changelog updated 2022-02-17 09:57:39 +01:00
julielenaerts 64e9461586 'ressources' changed to 'personnes ressources' plus order in menu changed 2022-02-17 09:57:29 +01:00
julielenaerts 5e01eebd25 'gabarit' changed to 'modèle' 2022-02-17 09:57:02 +01:00
julielenaerts bae2a385aa notification word 'one' changed to number 2022-02-17 09:56:41 +01:00
julielenaerts 9861e3fe1c csfixes 2022-02-17 09:43:49 +01:00
julienfastre 95b2fcead7 update changelog [ci-skip] 2022-02-16 21:58:49 +01:00
julienfastre 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
julienfastre aebb21935b fix page "my accompanying period" and do not show drafts periods in
homepage (+ ordering)
2022-02-16 19:57:35 +01:00
julielenaerts 20104f1b3b implementation in thirdpartyType 2022-02-16 16:58:37 +01:00
julielenaerts 25264447bc csfixes 2022-02-16 16:56:02 +01:00
julielenaerts c1036a3627 fix getParent() 2022-02-16 16:54:55 +01:00
julielenaerts f1a9a872bb creation of CivilityPicker and attempt to implement -> still error 2022-02-16 16:38:53 +01:00
julielenaerts 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
julielenaerts 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
julielenaerts c8922a6a82 minor correction 2022-02-16 14:26:00 +01:00
julielenaerts cdf0bb30c9 display of correct message for 403 error fixed + translation 2022-02-16 14:25:34 +01:00
julielenaerts e4793e1a77 minor fixes 2022-02-16 13:52:20 +01:00
julielenaerts 8347ddd5be bugfix if there is no address edit of resourceItem was not possible 2022-02-16 13:51:51 +01:00
julielenaerts 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
julielenaerts b0d50d315c Merge conflict in changelog fixed 2022-02-16 10:56:44 +01:00
julielenaerts 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
julielenaerts 769700fe83 comment removed 2022-02-16 10:55:44 +01:00
julielenaerts 433ccb1fc4 bugfix of double civility abbreviation after edit 2022-02-16 10:55:44 +01:00
julielenaerts 145c1d59e9 bugfix emit saveFormOnTheFly and add newly created contact to suggestion list immediately 2022-02-16 10:55:44 +01:00
julielenaerts ae8cc0f700 attempt to not include parent address 2022-02-16 10:55:24 +01:00
julielenaerts a764da3e99 changelog updated 2022-02-16 10:55:05 +01:00
julielenaerts 8f92f79f85 placeholders for civility and profession 2022-02-16 10:55:05 +01:00
julielenaerts f093765d03 correction for POST phonenumber and email 2022-02-16 10:55:05 +01:00
julielenaerts c44d962ba8 only show addcontact button for personne morale 2022-02-16 10:55:05 +01:00
julielenaerts 20d22b726c possible to add a contact to a thirdparty 2022-02-16 10:55:05 +01:00
julielenaerts 8fa2f0e7ad small corrections 2022-02-16 10:54:42 +01:00
julielenaerts 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
julielenaerts 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
julielenaerts 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
julielenaerts b16cc2dc27 translations added 2022-02-16 10:53:34 +01:00
julielenaerts 188447fc10 use correct button 2022-02-16 10:48:23 +01:00
julielenaerts b920bf6d22 parent id added to thirdparty data 2022-02-16 10:47:59 +01:00
julielenaerts 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
julielenaerts 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
julielenaerts 3b1fc4aacb translations added 2022-02-16 10:46:57 +01:00
julielenaerts bf9469d538 endpoints created for profession and civility for use in vue component 2022-02-16 10:46:35 +01:00
julielenaerts c2dec360b1 unsaved changes 2022-02-16 10:46:06 +01:00
julielenaerts dc7422bf56 unsaved changes 2022-02-16 10:46:06 +01:00
julielenaerts 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
julielenaerts 2ab7556ac3 Add workflows tab to dashboard 2022-02-16 10:26:00 +01:00
julielenaerts 3d38da7b37 Add workflow notifications to the dashboard 2022-02-16 10:25:18 +01:00
julielenaerts 056d5a3f98 Remove counter from 'mes parcours' 2022-02-16 10:24:05 +01:00
julienfastre 17612afd87 fix phpstan issues 2022-02-16 00:08:06 +01:00
julienfastre 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
julielenaerts 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
julielenaerts 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
julielenaerts 385664e2bc fix merge conflict 2022-02-15 10:01:01 +01:00
julienfastre 1658fee090 test on members editor post move + listen for event (wip) 2022-02-15 00:23:01 +01:00
julienfastre 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
julienfastre 861f461bc5 workflow context for accompanying course document: ensure persons are represented as an array in json 2022-02-14 20:19:56 +01:00
julienfastre b6c118a0c8 add informations to workflow normalization 2022-02-14 20:02:24 +01:00
julienfastre 89d3ab38f0 add endpoint to list workflows 2022-02-14 20:02:07 +01:00
julienfastre 441704dc29 first impl of event (WIP) 2022-02-14 18:29:11 +01:00
julielenaerts 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
julienfastre f2221565c5 update changelog [ci-skip] 2022-02-14 16:39:04 +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
julielenaerts df61fbff12 merge conflicts resolved 2022-02-14 14:55:47 +01:00
julienfastre 9ead38ee22 Merge branch 'issue_vendee_456_document_field_not_required' into 'master'
doc generation: add age and obele in the mainPerson, person1 and person2 list...

See merge request Chill-Projet/chill-bundles!336
2022-02-14 13:43:52 +00:00
julienfastre 6402962990 customize the 'none' into something more user-frieldly 2022-02-14 14:36:37 +01:00
julienfastre 9e9fa5039f fix cs 2022-02-14 14:26:12 +01:00
julienfastre e6d503a1e2 Merge remote-tracking branch 'origin/master' into issue_vendee_456_document_field_not_required 2022-02-14 14:25:10 +01:00
julienfastre 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
julielenaerts 4920142540 changelog updated 2022-02-14 14:14:05 +01:00
nobohan a7a1f699bb AddPersons: fix regression bug when editing a person/thirdparty without query 2022-02-14 14:13:06 +01:00
julielenaerts 61cf838458 if condition to check if a sender is assigned or if notification was assigned automatically by the system 2022-02-14 14:05:59 +01:00
nobohan 229a91ddf0 Accompanying course: treat vuejs warning by refactoring + delete unused v-model 2022-02-14 13:59:49 +01:00
julienfastre 68d0c66402 fix cs 2022-02-14 13:48:47 +01:00
julienfastre 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
julielenaerts bd05315de3 csfixes 2022-02-14 12:02:32 +01:00
julielenaerts d254a9e14a add endDate field in HouseholdMember form for enfant hors menage 2022-02-14 12:02:15 +01:00
julielenaerts e028c1ca2b thirdparty contact address blurred in view page if confidential 2022-02-14 11:44:12 +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
julienfastre 7dd6cd04ba Merge branch 'issue419_AddPersons_clear_ul' into 'master'
Issue419  remove ul-li in AddPersons

See merge request Chill-Projet/chill-bundles!328
2022-02-11 16:31:55 +00:00
julienfastre 1072f539dc Merge branch 'issue440_mesparcours_brouillon' into 'master'
Mes parcours brouillon

See merge request Chill-Projet/chill-bundles!330
2022-02-11 16:23:05 +00:00
julienfastre 9bcf4cce9f Merge branch 'master' into 'issue440_mesparcours_brouillon'
# Conflicts:
#   CHANGELOG.md
2022-02-11 16:22:51 +00:00
julienfastre 9223beac47 Merge branch 'issue416_chill_document_edit_button' into 'master'
Issue416 chill document edit button

See merge request Chill-Projet/chill-bundles!326
2022-02-11 16:21:15 +00:00
julienfastre 62c78e650f fix access denied when updating a work 2022-02-11 17:20:26 +01:00
julienfastre e7d0c1cac6 fix cs 2022-02-11 17:14:14 +01:00
julienfastre b859283766 fix error on creating an accompanying period work 2022-02-11 17:09:56 +01:00
julielenaerts 973644c62d csfixes 2022-02-11 17:07:47 +01:00
julielenaerts b9af54892b changelog updated 2022-02-11 17:04:15 +01:00
julielenaerts f9154233e4 using renderbox and adjusting style + show button if person or thirdparty 2022-02-11 17:02:31 +01:00
julienfastre e595500cb8 apply changes on person document 2022-02-11 17:01:36 +01:00
nobohan aa7da2559c [activity] correct associated persons by considering only open participations 2022-02-11 16:48:15 +01:00
julielenaerts 753a007172 translation added for kind of resource 2022-02-11 16:32:28 +01:00
julienfastre f34847f9f6 Merge remote-tracking branch 'origin/master' into issue416_chill_document_edit_button 2022-02-11 16:09:00 +01:00
julienfastre 0fa119c984 Merge branch 'issue_414_documents_list' into 'master'
created and updated traits added + template property added to Document entity

See merge request Chill-Projet/chill-bundles!316
2022-02-11 15:05:21 +00:00
julienfastre 270d00c1e8 fix phpstan and cs 2022-02-11 16:04:27 +01:00
julienfastre 983c5f3c6a fix probably missing variables in PersonDocumentType 2022-02-11 16:04:27 +01:00
julienfastre c6141e473f fix test in twig template 2022-02-11 16:04:26 +01:00
julielenaerts c30cb5879d changelog updated 2022-02-11 16:04:24 +01:00
julielenaerts 29e384ada5 scope placed within condition in edit form personDocument 2022-02-11 16:04:01 +01:00
julielenaerts c8e5ba4738 phpcsfixes 2022-02-11 16:04:01 +01:00
julielenaerts bf0b7f1bb2 Create AccompanyingCourseDocumentRepository and use to add pagination 2022-02-11 16:04:01 +01:00
julielenaerts d6cc69b919 Add pagination in the findBy() 2022-02-11 16:04:01 +01:00
julielenaerts ac33c6aad8 Add sticky buttons for create 2022-02-11 16:04:01 +01:00
julielenaerts 89383a5ec4 deprecated service replaced and error removed from phpstan file 2022-02-11 16:04:00 +01:00
julielenaerts 0fd26da299 comments in migration removed 2022-02-11 16:04:00 +01:00
julienfastre 6fa99655b2 delegates the acl for fetching person documents to an ACLAwareREpository 2022-02-11 16:04:00 +01:00
julienfastre a387305ef8 remove scope in PersonDocumentType when disabled 2022-02-11 16:04:00 +01:00
julielenaerts e0c7daf3fd Pagination added 2022-02-11 16:04:00 +01:00
julielenaerts 4304baeca5 scope put in condition in personDocument form - temporarily commented out 2022-02-11 16:04:00 +01:00
julielenaerts d2a567c79e condition added in show template for scope 2022-02-11 16:04:00 +01:00
julielenaerts 3c04ced1a3 templates adjusted 2022-02-11 16:04:00 +01:00
julielenaerts a28d8a7287 only add scope field conditionally in personDocumentType analogue to SingleTaskType 2022-02-11 16:04:00 +01:00
julielenaerts 1c055e842e created and updated traits added + template property added to Document entity 2022-02-11 16:04:00 +01:00
julienfastre dea283d655 fix phpstan and cs 2022-02-11 16:03:22 +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
julienfastre 58c8373c81 Merge branch 'issue378_normalize_requestor' into 'master'
accompanying course: normalize the requestor entity

See merge request Chill-Projet/chill-bundles!329
2022-02-11 14:45:32 +00:00
julienfastre a1ccfadac1 fix probably missing variables in PersonDocumentType 2022-02-11 15:42:40 +01:00
julienfastre 632b1262f9 Merge remote-tracking branch 'origin/master' into issue_414_documents_list 2022-02-11 15:34:31 +01:00
julienfastre e157624479 Merge branch 'master' into 'issue378_normalize_requestor'
# Conflicts:
#   CHANGELOG.md
2022-02-11 14:31:53 +00:00
julienfastre 3a2370d536 fix missing cases for accompanying period draft list
fix when:

* if there isn't any information into course => better render box
* if there isn't any course into list => display warning
2022-02-11 15:26:17 +01:00
nobohan eee38e9577 remove isDead from insert vue on the fly as dead sign (obele) is included in personRender->renderString 2022-02-11 15:18:54 +01:00
julielenaerts 50b7df1f4a adding thirdparty info 2022-02-11 15:16:28 +01:00
julienfastre 981c94906d Merge remote-tracking branch 'origin/master' into issue440_mesparcours_brouillon 2022-02-11 15:11:20 +01:00
julienfastre adce90c151 Merge remote-tracking branch 'origin/master' into issue440_mesparcours_brouillon 2022-02-11 15:11:08 +01:00
julienfastre 83f8402081 Merge branch 'issue415_household_address' into 'master'
Display address of current household in history page

See merge request Chill-Projet/chill-bundles!334
2022-02-11 14:10:52 +00:00
julienfastre 22417ee9f9 fix tests for address render 2022-02-11 15:03:54 +01:00
julielenaerts 3c5d269ece template fixes residential address 2022-02-11 14:58:11 +01:00
julienfastre 42579b5752 fix translation and how holder is shown 2022-02-11 14:49:59 +01:00
julienfastre 15023d348a Merge remote-tracking branch 'origin/master' into issue415_household_address 2022-02-11 14:39:27 +01:00
julienfastre fbf777e134 fix cs 2022-02-11 14:35:10 +01:00
julienfastre 450277f32a fix test in twig template 2022-02-11 14:34:35 +01:00
nobohan 1f5d529d33 php code fix 2022-02-11 14:30:31 +01:00
julielenaerts 93128cb61b if conditions joined 2022-02-11 14:28:42 +01:00
nobohan c19099e76c upd CHANGELOG 2022-02-11 14:28:37 +01:00
julienfastre d3d655293e Merge remote-tracking branch 'origin/master' into issue_414_documents_list 2022-02-11 14:24:36 +01:00
nobohan 692343aae4 doc generation: add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge 2022-02-11 14:24:12 +01:00
julienfastre 0592601aa6 Merge branch 'household-editor/show-full-address' 2022-02-11 14:22:41 +01:00
julienfastre a17f5948fb Merge remote-tracking branch 'origin/master' 2022-02-11 14:22:27 +01:00
nobohan 4dd9bc1123 doc generation: do not set required fields for mainPerson, person1, person2 2022-02-11 14:22:20 +01:00
julienfastre 6578f66fec update changelog 2022-02-11 14:22:10 +01:00
julienfastre 3f2a19a6f0 Merge remote-tracking branch 'origin/master' into household-editor/show-full-address 2022-02-11 14:21:06 +01:00
julienfastre d5160ead4c Apply 1 suggestion(s) to 1 file(s) 2022-02-11 13:18:51 +00:00
julienfastre a6e9cbdece Merge branch 'fix-tests-2022-02-11' into 'master'
fix ci

See merge request Chill-Projet/chill-bundles!335
2022-02-11 13:18:32 +00:00
julienfastre 657bf7075b fix ci 2022-02-11 13:18:32 +00:00
julielenaerts f1c3e8dc1b Merge remote-tracking branch 'origin/master' 2022-02-11 14:18:20 +01:00
julielenaerts a9624b36f7 create person and household option added to dropdown 2022-02-11 14:17:59 +01:00
julienfastre db4aec9a18 Merge branch 'issue427_returnPath' into 'master'
on the fly component: add returnPath when viewing

See merge request Chill-Projet/chill-bundles!324
2022-02-11 13:16:51 +00:00
julienfastre c34ce48a53 Merge branch 'master' into 'issue427_returnPath'
# Conflicts:
#   CHANGELOG.md
2022-02-11 13:16:40 +00:00
julienfastre 93345c09a1 fix cs 2022-02-11 13:45:21 +01:00
julienfastre b5a1985fa1 test "find household by reference": add exception in data provider
The data provider cannot generate data if no address reference in
database. Throw an exception in this case.
2022-02-11 13:43:29 +01:00
julienfastre 9b4c350213 fix tests for accompanying period comments 2022-02-11 13:36:35 +01:00
julienfastre 199a441593 fix tests for EntityWorkflow 2022-02-11 13:24:29 +01:00
Mathieu Jaumotte f42d106e3c Merge branch 'accent440' 2022-02-11 13:17:19 +01:00
Mathieu Jaumotte 13eddbfc5b changelog 2022-02-11 13:16:48 +01:00
Mathieu Jaumotte 7c30126fed Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-02-11 13:14:45 +01:00
julienfastre e3c5f6f95f fix phpcs, psalm and phpstan 2022-02-11 13:07:38 +01:00
Mathieu Jaumotte a86f1a05ac Merge branch 'accent440' 2022-02-11 13:04:35 +01:00
Mathieu Jaumotte 9ba0cb0c2a homepage_widget: fix translation for emergency badge 2022-02-11 12:56:15 +01:00
julielenaerts add8588767 changelog updated 2022-02-11 12:36:05 +01:00
julielenaerts a083a320ae display address of current household 2022-02-11 12:34:18 +01:00
julienfastre 64fa7f2e00 Merge branch 'issue433_email_addPerson' into 'master'
AddPerson: email and altNames corrections and validation

See merge request Chill-Projet/chill-bundles!327
2022-02-11 11:33:23 +00:00
julienfastre c7a830ee28 Merge branch 'master' into 'issue433_email_addPerson'
# Conflicts:
#   CHANGELOG.md
2022-02-11 11:33:09 +00:00
Mathieu Jaumotte 9aa51406fa Merge branch 'accent419' 2022-02-11 12:26:27 +01:00
julienfastre 344981cf99 Merge branch 'master' into issue433_email_addPerson 2022-02-11 12:16:49 +01:00
Mathieu Jaumotte 28c4d6b92f vue pick entity: fix i18n translations in create thirdparty modal 2022-02-11 12:16:01 +01:00
Mathieu Jaumotte ef2ab5faf6 vue pick entity: improve picked condition when value is empty string 2022-02-11 12:12:12 +01:00
julienfastre 54dbf711f9 fix cs 2022-02-11 12:10:44 +01:00
julienfastre bb93cb23a7 fix handling of address 2022-02-11 12:09:42 +01:00
julielenaerts 60951231c4 Merge branch 'issue415_household_address' of gitlab.com:Chill-Projet/chill-bundles into issue415_household_address 2022-02-11 11:57:49 +01:00
julielenaerts ece30b63c3 in process... need to be sure which address to display exactly 2022-02-11 11:45:23 +01:00
julielenaerts 94503505f7 changelog updated 2022-02-11 11:40:56 +01:00
julielenaerts 48589f3368 scope placed within condition in edit form personDocument 2022-02-11 11:33:07 +01:00
julielenaerts 1e04c178dc phpcsfixes 2022-02-11 11:28:32 +01:00
julielenaerts 37ed703abe Create AccompanyingCourseDocumentRepository and use to add pagination 2022-02-11 11:26:21 +01:00
julielenaerts 7ed20d2fc5 Add pagination in the findBy() 2022-02-11 11:25:53 +01:00
julielenaerts 5fe2a8e737 Add sticky buttons for create 2022-02-11 11:25:27 +01:00
nobohan 861abe708b upd CHANGELOG 2022-02-11 10:55:37 +01:00
julienfastre 57a88845dc Merge remote-tracking branch 'origin/master' into issue388_order_social_issues 2022-02-11 10:54:37 +01:00
nobohan f43e216e13 fix normalisation of AccompanyingCourse requestor api 2022-02-11 10:53:05 +01:00
julielenaerts 5210e7985f deprecated service replaced and error removed from phpstan file 2022-02-11 10:46:46 +01:00
julielenaerts ddabdff206 comments in migration removed 2022-02-11 10:45:30 +01:00
Mathieu Jaumotte 5a692db30f Fix review remarks 2022-02-10 17:51:45 +01:00
julienfastre 659983fef1 delegates the acl for fetching person documents to an ACLAwareREpository 2022-02-10 00:37:24 +01:00
julienfastre aca5a3c731 remove scope in PersonDocumentType when disabled 2022-02-10 00:12:55 +01:00
julienfastre 406cfc86cd add order in localisation entity list (api) 2022-02-09 23:44:38 +01:00
julienfastre 90da067fbd address: show full address in address text and adapt Vue 2022-02-09 22:21:48 +01:00
julielenaerts 3532e9dd8c changelog updated 2022-02-09 18:22:28 +01:00
julielenaerts fddb74f107 toggleConfidential reset to what it was before 2022-02-09 18:05:55 +01:00
Mathieu Jaumotte e7a6742964 OpenWopiLink, option title is maintened (replace button by options) 2022-02-09 18:04:56 +01:00
julielenaerts ee817b1d62 url's and method changed for toggleIntensity and toggleConfidential 2022-02-09 17:56:53 +01:00
Mathieu Jaumotte 3ffeaf419a mimetype document mapping (temporary) 2022-02-09 17:39:43 +01:00
julielenaerts a399804094 Endpoint created + swagger documentation + controller action 2022-02-09 17:38:35 +01:00
julielenaerts 05e9f118d7 Corrections voter + entity property intensity, not emergency 2022-02-09 17:18:45 +01:00
Mathieu Jaumotte ce2f64acd0 wopi edit extension: button call collabora not in a modal, but in a page (twig way) 2022-02-09 17:10:12 +01:00
julielenaerts 7aad5be29f Toggle_emergency variable added to voter 2022-02-09 17:08:29 +01:00
julielenaerts 41b0dd50bd emergency property write permission removed from entity 2022-02-09 17:07:58 +01:00
Mathieu Jaumotte 08f544f6ea add btn-wopilink button ; fix OpenWopiLink when options is null 2022-02-09 16:29:57 +01:00
julielenaerts 4e862cc585 Changelog updated 2022-02-09 16:20:59 +01:00
julielenaerts 05d2c3b2e8 Minor style adjustment within template
The content of the div aligned center
2022-02-09 16:19:42 +01:00
julielenaerts 513207e510 PHP csfixes 2022-02-09 16:08:27 +01:00
julielenaerts dee6ed6707 Listing of mes parcours changed to only display confirmed or closed
draft parcours are displayed in mes parcours brouillon
2022-02-09 16:02:21 +01:00
julielenaerts d60095987c Changelog updated 2022-02-09 15:59:19 +01:00
julielenaerts b4f9be0d92 openingDate only displayed on parcours that are not in draft state 2022-02-09 15:59:10 +01:00
julielenaerts a2a0f6af44 mes parcours brouillon added to usermenu 2022-02-09 15:58:54 +01:00
julielenaerts 7fa0353d8c Pagination added 2022-02-09 15:10:04 +01:00
julielenaerts 9256c71715 scope put in condition in personDocument form - temporarily commented out 2022-02-09 14:38:20 +01:00
julielenaerts 5520f3df50 condition added in show template for scope 2022-02-09 14:37:48 +01:00
julielenaerts a6c0d8b219 templates adjusted 2022-02-09 14:37:06 +01:00
Mathieu Jaumotte f6e667700e move twig function in runtime 2022-02-09 13:19:58 +01:00
julielenaerts f94ef0798a Merge branch 'issue_414_documents_list' of gitlab.com:Chill-Projet/chill-bundles into issue_414_documents_list 2022-02-09 10:15:18 +01:00
julielenaerts 7bd7476200 only add scope field conditionally in personDocumentType analogue to SingleTaskType 2022-02-09 10:15:09 +01:00
julielenaerts a2752765af created and updated traits added + template property added to Document entity 2022-02-09 09:54:21 +01:00
julielenaerts 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
julienfastre 1e81256404 fix cs 2022-02-08 19:37:59 +01:00
julienfastre 6b571e87b4 fix typos 2022-02-08 19:37:11 +01:00
julienfastre 4314823a70 change order for accompanying period work list 2022-02-08 19:36:45 +01:00
julienfastre dc08ced6c9 fix notification subject 2022-02-07 21:49:34 +01:00
julienfastre 9d660311f0 improve translation on working about houshold members 2022-02-07 20:54:06 +01:00
julienfastre b3e65f0733 fix validation when comment content is empty 2022-02-07 20:53:44 +01:00
julienfastre 03007370bc fix "impossible to confirm a course"
In some case, the "confirm" button for the form AccompanyingCourse was
disable, due to wrong condition.

This commit also fixes the filtering for users, and allow to remove a
user associated with an accompanyingCourse.
2022-02-07 17:44:03 +01:00
julienfastre f9b514c869 fix assertion of type.
https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/266
2022-02-07 11:22:35 +01:00
julielenaerts bc2d4c1066 Merge remote-tracking branch 'origin/issue433_email_addPerson' into issue345_internal_thirdparty_contact 2022-02-04 11:09:51 +01:00
julielenaerts 298b597dd0 comment removed 2022-02-04 10:50:59 +01:00
nobohan 91ba08dfa1 accompanying course: normalize the requestor entity 2022-02-04 10:34:32 +01:00
julielenaerts 481456a038 Merge conflicts fixed 2022-02-04 10:25:46 +01:00
nobohan 06142797c3 AddPersons: add missing css class + upd CHANGELOG 2022-02-03 16:25:59 +01:00
nobohan 4185b660cc AddPersons: remove ul-li html tags from AddPersons 2022-02-03 16:17:05 +01:00
Mathieu Jaumotte ad46776164 hide save and close button in modal header 2022-02-03 15:58:57 +01:00
julienfastre 2343a4a334 add links between document in workflow and course 2022-02-03 13:49:52 +01:00
julienfastre 3f83c323be fix creating workflow from document in accompanying course 2022-02-03 13:16:13 +01:00
julienfastre 9a9ed64298 fix on test after creating an activity without generating a document 2022-02-03 12:54:44 +01:00
nobohan a0cadb46db upd CHANGELOG 2022-02-03 11:32:11 +01:00
nobohan f139af8b6f accompanying course work: fix on-the-fly update of thirdParty 2022-02-03 11:26:31 +01:00
nobohan 1f0ef6e187 on-the-fly: close modal only after validation 2022-02-03 11:07:32 +01:00
nobohan 4afea55465 addperson: repair altname: add altname if known 2022-02-03 09:17:45 +01:00
nobohan 3d5723facb AddPerson: correct thirdparty PATCH url + add email and altnames in AddPerson and serializer 2022-02-03 08:59:56 +01:00
julienfastre 211ecf1c3e add cache to workflow counter 2022-02-02 23:19:59 +01:00
julienfastre 796b4ff76b Merge branch 'master' into issue431_worklow_notifications 2022-02-02 22:40:37 +01:00
julienfastre 9553e18d83 do not uppercase/lowercase ref in activity list 2022-02-02 22:17:24 +01:00
julienfastre 02d9a713de set requestor before acdtions 2022-02-02 22:16:15 +01:00
julienfastre 6cc4fa582e fix validation error with startDate 2022-02-02 22:15:53 +01:00
Mathieu Jaumotte b8d43f36eb document: add macro mapping forkawesome icon from mime type 2022-02-02 19:39:17 +01:00
Mathieu Jaumotte 06b3d63133 pass options in twig extension filter 2022-02-02 18:28:59 +01:00
Mathieu Jaumotte 232e71f46c uniformize ui with sticky-form-button 2022-02-02 18:25:44 +01:00
Mathieu Jaumotte 0b5a0e65a8 ckeck document mime (TO BE CHECKED) 2022-02-02 16:53:13 +01:00
Mathieu Jaumotte ef42227e6c data-doc-title is a not required props 2022-02-02 15:13:48 +01:00
Mathieu Jaumotte 2af3de4f61 chill_document_edit_button: create new twig extension 2022-02-02 14:57:25 +01:00
julielenaerts 8bafa37fe1 dump removed 2022-02-02 10:32:46 +01:00
nobohan a83b0326d7 upd CHANGELOG 2022-02-02 07:04:14 +01:00
julienfastre 53e03395f2 renaming date de fermeture en date de cloture in accompanying course 2022-02-01 22:36:51 +01:00
julienfastre 5fef4048a4 use renderbox in activity list recent 2022-02-01 22:36:26 +01:00
julienfastre d8929a6222 Merge branch 'master' into homepage/rewrite 2022-02-01 21:26:27 +01:00
julienfastre 33af7f36a0 remove dump 2022-02-01 21:23:50 +01:00
julienfastre 3f2454cead disable multiselect search in City and Street search 2022-02-01 21:23:15 +01:00
julienfastre 0ac9f2df8c fix loading of file template 2022-02-01 21:20:11 +01:00
Mathieu Jaumotte 333224a9d5 update changelog 2022-02-01 19:19:50 +01:00
Mathieu Jaumotte 496e5f0259 homepage: fix counter appareance on MyCustoms vue tab 2022-02-01 19:13:25 +01:00
julienfastre f2a62822a4 Merge remote-tracking branch 'origin/master' 2022-02-01 18:43:39 +01:00
julienfastre 7879a99197 Merge branch 'master' into issue425_errorMessage_closeParcours 2022-02-01 18:42:59 +01:00
julielenaerts 72d8cc297f Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-02-01 18:41:07 +01:00
julielenaerts 1a0674a20b using badges instead of eye for person resource list 2022-02-01 18:40:57 +01:00
julienfastre 572aa2c14e Merge remote-tracking branch 'origin/master' into issue426_household_composition 2022-02-01 18:29:02 +01:00
julienfastre bc4b2c4e86 Merge branch 'master' into issue428_person_resource_ameliorations 2022-02-01 18:08:48 +01:00
julienfastre a227e88e79 Merge branch 'master' into small_issues_421_424 2022-02-01 18:05:33 +01:00
julienfastre d9e9f472fb Merge remote-tracking branch 'origin/small_issues_421_424' into small_issues_421_424 2022-02-01 18:02:25 +01:00
julienfastre fcff4bf863 fix phpcs 2022-02-01 18:01:34 +01:00
julienfastre 79b82e09e1 add document from activity 2022-02-01 17:58:20 +01:00
nobohan a78f29cffc on the fly component: add returnPath when viewing 2022-02-01 17:44:55 +01:00
Mathieu Jaumotte e98b1b049b add context to MyEvaluations (action and course containers) 2022-02-01 17:28:30 +01:00
julielenaerts 99efa51794 csfixes 2022-02-01 17:23:45 +01:00
julielenaerts 76932e6e8c bugfix in notificationhandler. Not sure about the fix in the template 2022-02-01 17:23:12 +01:00
julielenaerts 97d2e3d5b5 counter created for workflows for which user is a destuser and that are not finalized 2022-02-01 17:22:45 +01:00
nobohan 2c94811c8f person: social issue api controller: add onPostIndexBuildQuery 2022-02-01 17:01:19 +01:00
Mathieu Jaumotte a2063ab13b Merge branch 'master' into homepage/rewrite 2022-02-01 16:54:49 +01:00
nobohan eb32b13bcc person: rewrite social issue api controller for ordering 2022-02-01 16:49:14 +01:00
Mathieu Jaumotte 2bb718f3ea fix popover header on vue ListWorkflow breadcrumb 2022-02-01 15:51:42 +01:00
julienfastre c6373a075d refactor pickTemplate and adapt existing usage 2022-02-01 15:49:23 +01:00
julielenaerts 46337ef25d in process... need to be sure which address to display exactly 2022-02-01 15:09:42 +01:00
Mathieu Jaumotte 2f5fecf414 notifications: fix comments counter 2022-02-01 14:56:50 +01:00
julienfastre 5d2cb8c712 homepage: add social action in evaluation serialisation 2022-02-01 14:14:55 +01:00
Mathieu Jaumotte 460502a1f2 mask unready comments counter 2022-02-01 14:13:08 +01:00
Mathieu Jaumotte cdd7a16d18 homepage_widget counters pluralization 2022-02-01 14:10:19 +01:00
Mathieu Jaumotte ec29758547 detect span.counter and allow to put styles on the number 2022-02-01 14:09:29 +01:00
julielenaerts c5cbdd97ff csfixes 2022-02-01 13:52:42 +01:00
julielenaerts 05fc5a1829 changelog updated 2022-02-01 13:52:13 +01:00
julielenaerts c3de3c6c39 validation adjusted to greaterThanOrEqual and different message passed 2022-02-01 13:51:21 +01:00
julielenaerts 1530e9d13a changelog updated 2022-02-01 12:37:09 +01:00
julielenaerts a986b4ae98 csfixes 2022-02-01 12:33:09 +01:00
julielenaerts 0854b7fc6a delete action created in controller and template 2022-02-01 12:32:34 +01:00
Mathieu Jaumotte 730199cca4 Merge branch 'foldlist_in_entity' into homepage/rewrite 2022-02-01 12:23:19 +01:00
julienfastre de1dddbb85 validation: no more workflow without dest 2022-02-01 12:19:51 +01:00
julienfastre a612d7dd9f improve workflow decision form 2022-02-01 12:19:51 +01:00
julienfastre 50e722e637 fix workflow redirection in accompanying period work edit 2022-02-01 12:19:51 +01:00
Mathieu Jaumotte e4d5e40a8b improve homepage_widget tables with datas 2022-02-01 12:07:16 +01:00
julielenaerts 479ec25d99 Merge branch 'issue428_person_resource_ameliorations' of gitlab.com:Chill-Projet/chill-bundles into issue428_person_resource_ameliorations 2022-02-01 10:18:21 +01:00
julielenaerts 930b6ff77e minor style changes 2022-02-01 10:17:08 +01:00
julielenaerts 7d8bd089a2 double edit button removed 2022-02-01 10:09:48 +01:00
Pol Dellaiera ebdcc5a07d fix: Update namespace to prevent having issues with PSR4 autoloading. 2022-02-01 09:11:14 +01:00
Pol Dellaiera 0f31a49890 fix: Update namespace to prevent having issues with PSR4 autoloading. 2022-02-01 09:10:32 +01:00
LenaertsJ 2c566bb21c Merge branch 'master' into 'issue428_person_resource_ameliorations'
# Conflicts:
#   CHANGELOG.md
2022-01-31 17:50:08 +00:00
julielenaerts a0bc6c7604 csfixes 2022-01-31 18:47:06 +01:00
julielenaerts a4457664d4 bugfix addPersons 2022-01-31 18:33:29 +01:00
julielenaerts b42ae76bdf Merge branch 'small_issues_421_424' of gitlab.com:Chill-Projet/chill-bundles into small_issues_421_424 2022-01-31 17:46:18 +01:00
julielenaerts 2eb1ebd263 changelog updated with bugfix 2022-01-31 17:45:22 +01:00
julielenaerts b79885cd21 bugfix creation of person or thirdparty through onTheFly 2022-01-31 17:45:04 +01:00
julielenaerts 69dd920fd6 php csfixes 2022-01-31 17:45:04 +01:00
julielenaerts 0689ca366d changelog updated 2022-01-31 17:44:04 +01:00
julielenaerts af1c268784 commentfield for marital status is always visible 2022-01-31 17:43:50 +01:00
julielenaerts 1162c436c1 demandeur not displayed in search list if anonymous 2022-01-31 17:43:50 +01:00
julienfastre 170ce2d51c minor fix and renaming 2022-01-31 16:55:19 +01:00
Mathieu Jaumotte 571a8a0edc Merge branch 'foldlist_in_entity' of gitlab.com:Chill-Projet/chill-bundles into foldlist_in_entity 2022-01-31 15:55:52 +01:00
Mathieu Jaumotte bdbb83ab85 wip count comments 2022-01-31 15:53:57 +01:00
julienfastre 971789d5cf Merge remote-tracking branch 'origin/master' into foldlist_in_entity 2022-01-31 15:51:21 +01:00
julienfastre 72815e4b70 Merge branch 'homepage/rewrite' 2022-01-31 15:40:40 +01:00
julienfastre 44183957b8 Merge remote-tracking branch 'origin/master' into homepage/rewrite 2022-01-31 15:36:53 +01:00
julienfastre 434d672d8a Merge branch 'master' into small_issues_421_424 2022-01-31 14:49:38 +01:00
julienfastre 5f6cffa08a fix regression in serach results appareance in addpersons 2022-01-31 14:49:23 +01:00
julielenaerts e21ff588ae csfixes 2022-01-31 14:42:54 +01:00
julielenaerts 0383571a9e changelog updated 2022-01-31 14:42:17 +01:00
julielenaerts f358e78734 onthefly button added to view person or thirdparty + badge changed if thirdparty is a contact 2022-01-31 14:39:40 +01:00
julienfastre 43ef31b93f Merge remote-tracking branch 'origin/master' into small_issues_421_424 2022-01-31 14:28:30 +01:00
julienfastre 222dae3c32 Merge remote-tracking branch 'origin/master' into issue420_closeModalAddPerson 2022-01-31 14:24:45 +01:00
julienfastre 08c13b8c98 Merge remote-tracking branch 'origin/master' into issue412_413_activity 2022-01-31 14:22:34 +01:00
julienfastre 1bc2500b28 update changelog [ci-skip] 2022-01-31 14:18:10 +01:00
Mathieu Jaumotte f648a9351b workflow: fix some stuffs 2022-01-31 14:17:10 +01:00
julienfastre ffe466a334 fix icon for searching 2022-01-31 14:16:33 +01:00
nobohan 3978e7c959 upd CHANGELOG 2022-01-31 13:48:21 +01:00
nobohan 2eb5c45a4d accompanying course: fetch scopes only for app (not for banner) 2022-01-31 13:46:43 +01:00
julielenaerts 15393d9da9 changelog updated with bugfix 2022-01-31 13:45:41 +01:00
julielenaerts 695d22adba bugfix creation of person or thirdparty through onTheFly 2022-01-31 13:39:52 +01:00
nobohan fefe208260 accompanying course: fetch users and suggested referrers only for app, not for banner 2022-01-31 13:32:34 +01:00
julielenaerts bc1a63354c php csfixes 2022-01-31 13:11:25 +01:00
Mathieu Jaumotte c14101714c update changelog 2022-01-31 13:09:13 +01:00
julielenaerts faebb0fe30 changelog updated 2022-01-31 13:08:55 +01:00
julienfastre 8ec5636c57 Merge remote-tracking branch 'origin/master' into household-editor/push-to-household 2022-01-31 13:07:26 +01:00
julielenaerts 68d99050bc commentfield for marital status is always visible 2022-01-31 13:06:59 +01:00
Mathieu Jaumotte fba7060a91 update changelog 2022-01-31 13:05:41 +01:00
julienfastre 6894fa7101 Merge branch 'issue389_add_age' into 'master'
add age/ person text component

See merge request Chill-Projet/chill-bundles!308
2022-01-31 12:04:48 +00:00
julienfastre 41fa1d9ca6 fix cs 2022-01-31 13:02:43 +01:00
julienfastre f4bca2f410 add person text in accompanying period work 2022-01-31 13:00:48 +01:00
Mathieu Jaumotte 6198891202 add anchor to retrieve evaluations section in accompanyingCourseWorkEdit page 2022-01-31 12:47:31 +01:00
Mathieu Jaumotte c806c06279 homepage_widget: basically build tables for evaluations, tasks and courses 2022-01-31 12:46:44 +01:00
julienfastre e04c02055c add age in some place and re-organize some usage of the component 2022-01-31 12:45:50 +01:00
julielenaerts 4fa1bb4341 demandeur not displayed in search list if anonymous 2022-01-31 12:45:02 +01:00
LenaertsJ ac5675933d Merge branch 'issue411_openingDate_parcours' into 'master'
Opening date of parcour

See merge request Chill-Projet/chill-bundles!313
2022-01-31 11:07:07 +00:00
Mathieu Jaumotte e7db71b0f3 fast actions are custom overrided buttons 2022-01-31 12:03:42 +01:00
nobohan 1967fc4bed upd CHANGELOG 2022-01-31 12:01:52 +01:00
nobohan befd5dac42 person: accompanying course: treat validation error when editing on-the-fly entities 2022-01-31 12:00:40 +01:00
julienfastre 186b8847d9 Merge remote-tracking branch 'origin/issue389_add_age' into issue389_add_age 2022-01-31 11:46:07 +01:00
julienfastre 90d0cbc3b1 Merge remote-tracking branch 'origin/master' into issue389_add_age 2022-01-31 11:44:55 +01:00
LenaertsJ ac3d39b151 Merge branch 'master' into 'issue389_add_age'
# Conflicts:
#   CHANGELOG.md
2022-01-31 10:25:32 +00:00
Mathieu Jaumotte efb5bd64b4 notification-list: todo add a comment counter 2022-01-31 11:25:23 +01:00
LenaertsJ 76a7b019eb Merge branch 'master' into 'issue411_openingDate_parcours'
# Conflicts:
#   CHANGELOG.md
2022-01-31 10:19:54 +00:00
julielenaerts 739540af64 created and updated traits added + template property added to Document entity 2022-01-31 11:13:22 +01:00
Mathieu Jaumotte 230d73498e workflow list: mask title 2022-01-31 11:02:01 +01:00
nobohan a68a43adc0 upd CHANGELOG 2022-01-31 10:55:11 +01:00
nobohan 5a75e38f33 accompanying course: close modal when edit participation 2022-01-31 10:48:04 +01:00
julienfastre 1c02eb23fd fix user search 2022-01-31 10:41:08 +01:00
Mathieu Jaumotte 1ba5df1280 hop 2022-01-31 09:45:37 +01:00
Mathieu Jaumotte 73c4a5d39d better color coherency with buttons 2022-01-30 19:45:09 +01:00
Mathieu Jaumotte 0a58c43952 fix date format on popover 2022-01-30 19:43:17 +01:00
Mathieu Jaumotte a3b823d33f improve workflow button 2022-01-30 16:43:09 +01:00
Mathieu Jaumotte de45555c5a add popover html content 2022-01-30 16:35:47 +01:00
Mathieu Jaumotte 0add020e57 workflows in entity: other vue component call workflow modal 2022-01-30 13:53:51 +01:00
Mathieu Jaumotte 84a76d2c76 ListWorkflow: styles for list (like in twig) 2022-01-30 13:36:37 +01:00
Mathieu Jaumotte d88207132b workflows in entity: twig call once vue component that list in modal with add button, or just display add button if none 2022-01-30 11:26:04 +01:00
Mathieu Jaumotte 932d0e86d9 Merge branch 'foldlist_in_entity' of gitlab.com:Chill-Projet/chill-bundles into foldlist_in_entity 2022-01-29 12:37:48 +01:00
julienfastre 671f1223b5 Merge branch 'issue_mes_parcours' into 'master'
Mes parcours

See merge request Chill-Projet/chill-bundles!307
2022-01-29 02:09:04 +00:00
julienfastre 1a04d903fc fixes for page 'mes parcours' 2022-01-29 03:08:34 +01:00
julienfastre 125dd4d980 Merge remote-tracking branch 'origin/master' into issue_mes_parcours 2022-01-29 02:58:32 +01:00
julienfastre 2ddab027ed Merge remote-tracking branch 'origin/master' into issue410_restyle_parcourslist_personSearch 2022-01-29 02:57:05 +01:00
julienfastre 1724400d7c button requestor on the right 2022-01-29 02:56:06 +01:00
julienfastre d1a0934bb1 search household in household mmebers editor 2022-01-29 02:38:47 +01:00
julienfastre bc90664480 api endpoint for search household 2022-01-29 01:14:30 +01:00
julienfastre 99dc7490cb missing translation 2022-01-29 00:33:09 +01:00
julienfastre 5ac485e06e example of workflow + finalize normalization 2022-01-29 00:20:35 +01:00
julienfastre dc184762d6 workflow history 2022-01-29 00:20:35 +01:00
julienfastre 86e7b0f007 rewrite workflow and handle finalize differently 2022-01-29 00:20:35 +01:00
julienfastre fdafe7c82b normalizer for entityworkflow 2022-01-29 00:20:35 +01:00
Mathieu Jaumotte d285d84068 wip 2022-01-28 22:30:18 +01:00
Mathieu Jaumotte da22532587 cancel comments in entity notifications 2022-01-28 22:27:30 +01:00
Mathieu Jaumotte b83ad77fd8 homepage_widget: details + courses table 2022-01-28 18:22:33 +01:00
Mathieu Jaumotte 00ac6aa1b9 homepage_widget: init counters on load, arrange MyCustoms tab 2022-01-28 18:10:48 +01:00
julielenaerts 318c001904 changelog updated 2022-01-28 18:07:20 +01:00
julielenaerts e2d406b97b php validation added 2022-01-28 18:06:13 +01:00
nobohan efff496f7a hot fix: pick-entity: set input.value to null if multiple=false 2022-01-28 18:01:29 +01:00
julielenaerts fe4eaa92be fix bug display current openingDate in datepicker 2022-01-28 17:36:59 +01:00
julielenaerts cb17a7e8a5 Visual improvements of date input fields in social action create form 2022-01-28 17:06:09 +01:00
julielenaerts ad4153a07e New component for parcours startDate 2022-01-28 17:05:41 +01:00
Mathieu Jaumotte e95093f144 Merge branch 'homepage/rewrite' of gitlab.com:Chill-Projet/chill-bundles into homepage/rewrite 2022-01-28 16:36:01 +01:00
julienfastre 59cdf07c7e add form in notification thread inside entities show 2022-01-28 16:23:41 +01:00
julienfastre 292c9380ad endpoint for recent accompanying period attributions 2022-01-28 15:39:37 +01:00
Mathieu Jaumotte 701ad17299 Merge branch 'homepage/rewrite' of gitlab.com:Chill-Projet/chill-bundles into homepage/rewrite 2022-01-28 15:24:05 +01:00
Mathieu Jaumotte 7f41f14959 resume page: move notify button in masonry bloc and notification list below in content 2022-01-28 15:21:44 +01:00
julienfastre fcd5fba13e add history for user in accompanying period (+ counter) 2022-01-28 14:42:18 +01:00
Mathieu Jaumotte 2c57eab4d2 workflows list: rename tabs translations 2022-01-28 14:18:11 +01:00
julienfastre 2cd51eed2e Merge remote-tracking branch 'origin/master' into homepage/rewrite 2022-01-28 14:13:28 +01:00
Mathieu Jaumotte 72e306b583 change add notification button color 2022-01-28 12:46:58 +01:00
Mathieu Jaumotte 917dd49d07 workflows: add freeze mechanism on breadcrumbs, edit document button, and history 2022-01-28 12:41:44 +01:00
julielenaerts 71ca912749 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-01-28 12:25:06 +01:00
julielenaerts 4620e32b82 changelog updated 2022-01-28 12:20:29 +01:00
julielenaerts 0cda5d637d styling of parcours list in person search changed 2022-01-28 12:16:32 +01:00
julielenaerts 646f39b9ed Merge conflicts fixed 2022-01-28 12:15:51 +01:00
nobohan 105fe16122 upd CHANGELOG 2022-01-28 11:40:30 +01:00
nobohan 4d1a553474 show activity attendee (présence) in the activity list 2022-01-28 11:40:08 +01:00
julielenaerts 5bfdee0c28 corrections review 2022-01-28 11:09:14 +01:00
julienfastre ae33392ad0 update changelog 2022-01-28 10:58:24 +01:00
julienfastre 0e0fe90277 Merge branch 'issue399_dynamicPicker_asideActivity' into 'master'
dynamic picker aside activity

See merge request Chill-Projet/chill-bundles!305
2022-01-28 09:55:27 +00:00
LenaertsJ 792eafce72 dynamic picker aside activity 2022-01-28 09:55:26 +00:00
julienfastre 616d01a6c9 Merge branch 'issue403_residential_address' into 'master'
residentialAddress

See merge request Chill-Projet/chill-bundles!302
2022-01-28 09:48:00 +00:00
juminet 21edc74ada residentialAddress 2022-01-28 09:48:00 +00:00
Mathieu Jaumotte ab23290599 refund extension_list_notification template: change place and content 2022-01-28 10:22:48 +01:00
Mathieu Jaumotte 1a2e1eaf2a put notification comments in a separate include 2022-01-28 10:22:17 +01:00
julielenaerts feaee8a0b1 a few more implementations in twig templates 2022-01-28 10:07:34 +01:00
julielenaerts 0a26e7f326 using serialized age instead of function + translation fix 2022-01-28 09:57:14 +01:00
Mathieu Jaumotte ebf85d4e4d Merge branch 'homepage/rewrite' of gitlab.com:Chill-Projet/chill-bundles into homepage/rewrite 2022-01-28 09:56:52 +01:00
Mathieu Jaumotte 72cffd7a3d minor changes 2022-01-28 09:56:20 +01:00
julienfastre 65418b17ce Merge branch 'issues_362_filiations' into 'master'
filiations: small adjustments (colors, labels, ...)

See merge request Chill-Projet/chill-bundles!309
2022-01-28 08:49:59 +00:00
juminet 8432c215a3 filiations: small adjustments (colors, labels, ...) 2022-01-28 08:49:59 +00:00
nobohan 87e1f8f077 hot fix: initialize typed comment in CommentEmbeddable 2022-01-28 09:47:36 +01:00
nobohan 33f393203e activity admin: change validation rule for social action visible field 2022-01-27 19:43:08 +01:00
julielenaerts 6aa1e136b4 fix bug when suggested person is thirdparty 2022-01-27 18:14:32 +01:00
julielenaerts 10a9b6c909 using normalizer for age and added obele 2022-01-27 18:13:46 +01:00
julienfastre ce912e4405 ajout compteurs 2022-01-27 17:28:59 +01:00
julienfastre ab11d3e8b3 Merge branch 'issue400_sort_activity' into 'master'
activity: order activities by date and by id

See merge request Chill-Projet/chill-bundles!301
2022-01-27 16:12:08 +00:00
juminet 445fe0cee4 activity: order activities by date and by id 2022-01-27 16:12:07 +00:00
julienfastre 7c6c8de456 Merge branch 'issue394_address_confidential' into 'master'
confidential address

See merge request Chill-Projet/chill-bundles!299
2022-01-27 16:08:58 +00:00
julienfastre 0378df42b6 fix cs 2022-01-27 17:08:00 +01:00
julienfastre ad8d40cb1c work on confidential / blur module 2022-01-27 16:52:46 +01:00
julielenaerts f4516f8369 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-01-27 16:31:41 +01:00
julielenaerts 5b25f82963 changelog updated 2022-01-27 16:24:35 +01:00
julielenaerts 8720cc730e implementation of person-text 2022-01-27 16:19:19 +01:00
julielenaerts 44d1535bfb style fixes 2022-01-27 16:18:54 +01:00
julielenaerts 8d663cdee6 creation of vue component person-text 2022-01-27 16:18:35 +01:00
julienfastre 7c8b08c3a7 Merge branch 'master' into issue394_address_confidential 2022-01-27 15:39:10 +01:00
julienfastre 6df570d96c set referrer app 2022-01-27 15:22:15 +01:00
julielenaerts 3ce650eea6 Merge branch 'issue389_add_age' of gitlab.com:Chill-Projet/chill-bundles into issue389_add_age 2022-01-27 13:03:02 +01:00
julielenaerts 6ef7d9b47b adding age in renderbox and renderstring, implementation of renderbox option in household summary 2022-01-27 12:59:14 +01:00
julielenaerts af3847366b adding age in renderbox and renderstring, implementation of renderbox option in household summary 2022-01-27 12:33:50 +01:00
julielenaerts d70f8aa712 phpstan fixes 2022-01-27 11:50:26 +01:00
julielenaerts 14463dcd38 changelog updated 2022-01-27 11:45:03 +01:00
julielenaerts b9c2d63a53 mes parcours page created 2022-01-27 11:42:14 +01:00
julielenaerts 3fd4c6339a Merge conflicts resolved 2022-01-27 11:34:57 +01:00
julienfastre 4d76de5f9f fix normalization for person in docgen 2022-01-26 23:52:27 +01:00
julienfastre 0a92ad905b variables for docgen 2022-01-26 23:49:24 +01:00
julienfastre 7af7135971 use trait to implement TrackCreationInterface and TrackUpdateInterface 2022-01-26 21:51:13 +01:00
julienfastre c70a4dc664 fix loading of evaluations 2022-01-26 21:46:07 +01:00
julienfastre dc0fae7549 fixes person resources 2022-01-26 17:53:09 +01:00
julielenaerts b38924cc3d Revert "Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles"
This reverts commit 58c4e37116.
2022-01-26 16:38:58 +01:00
julielenaerts 58c4e37116 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2022-01-26 16:04:09 +01:00
julielenaerts 3656825d20 bug fix in form and controller 2022-01-26 15:56:10 +01:00
Mathieu Jaumotte 39a7cecd24 homepage_widget: improve notifications rows 2022-01-26 15:44:17 +01:00
julielenaerts 6d382f93e8 use pickDynamicUserType 2022-01-26 15:08:47 +01:00
julienfastre 6e554e74ab Merge branch 'issue382_person_resource' 2022-01-26 14:43:50 +01:00
julielenaerts 4c125865cf fix of twig if condition for person resources 2022-01-26 14:21:39 +01:00
julienfastre 12c68a4c9f Merge branch 'issue406_truncate_comment' into 'master'
Truncate comment

See merge request Chill-Projet/chill-bundles!304
2022-01-26 13:06:04 +00:00
julienfastre 66ac5c7435 Merge remote-tracking branch 'origin/master' into issue406_truncate_comment 2022-01-26 14:03:49 +01:00
julienfastre e4b46a188c Merge branch 'master' into issue406_truncate_comment 2022-01-26 14:01:42 +01:00
julienfastre 7a78e8a6a7 fixes for pesonnes ressources 2022-01-26 14:00:45 +01:00
julienfastre 4496836cb2 Merge branch 'issue382_person_resource' into 'master'
Creation of PersonResource

See merge request Chill-Projet/chill-bundles!291
2022-01-26 12:52:15 +00:00
LenaertsJ 88d1fe24b4 Creation of PersonResource 2022-01-26 12:52:15 +00:00
julienfastre 0ea1708fe9 Merge branch 'master' into issue382_person_resource 2022-01-26 13:50:58 +01:00
julienfastre a9b7cf93e9 adaptation for list for regulation 2022-01-26 13:50:19 +01:00
julielenaerts 5d36e56641 changelog updated 2022-01-26 12:57:14 +01:00
julielenaerts f00dfad98e csfixes 2022-01-26 12:56:02 +01:00
julielenaerts 7943c22ae7 comments truncated and link added to comment page 2022-01-26 12:55:48 +01:00
julielenaerts d365fcea39 merge conflict in changelog resolved 2022-01-26 12:13:37 +01:00
julielenaerts 9f9f9d7881 csfixes 2022-01-26 12:10:51 +01:00
julielenaerts 20f814766c merge fixes 2022-01-26 12:10:18 +01:00
julielenaerts ed00a882af cs-fixes 2022-01-26 12:08:18 +01:00
julielenaerts 5d7501d36e violation added if all three association entities are null 2022-01-26 12:08:18 +01:00
julielenaerts ab5f9923a6 CSfixer changes 2022-01-26 12:08:18 +01:00
julielenaerts 1a5e8b9d7b Fix user/thirdparty/freetext field in edit form 2022-01-26 12:08:18 +01:00
julielenaerts f7f2bb0caa reorganize templates to fix edit form 2022-01-26 12:08:18 +01:00
julielenaerts bf7fcfa41a bugfixes in display of dynamicPicker 2022-01-26 12:08:18 +01:00
julielenaerts 9056ea8449 styling changes collapse form 2022-01-26 12:08:18 +01:00
julielenaerts f0e349a2b0 show-hide files combined into one js file 2022-01-26 12:08:18 +01:00
julielenaerts 2ccc6f1976 fix backend error of data transformer 2022-01-26 12:08:18 +01:00
julienfastre cf041cf49e merge dynamic types 2022-01-26 12:08:18 +01:00
julienfastre 72d593e416 improve migration 2022-01-26 12:08:18 +01:00
julielenaerts 287dca07aa php cs-fixes 2022-01-26 12:08:18 +01:00
julielenaerts 910f9a7e8e update changelog 2022-01-26 12:08:18 +01:00
julielenaerts 9457483a6b different dynamic entity picker types created 2022-01-26 12:08:18 +01:00
julielenaerts 6d07168529 type variable added and file renamed in transformer 2022-01-26 12:08:18 +01:00
julielenaerts 420f81ea24 fix phpstan error 2022-01-26 12:08:18 +01:00
julielenaerts 416b62fc60 show hide functional 2022-01-26 12:08:18 +01:00
julielenaerts ecae7dab44 add placeholders for inputs 2022-01-26 12:07:39 +01:00
julielenaerts 126bd1a4eb fix for comment embeddable null + template adjustments 2022-01-26 12:07:39 +01:00
julielenaerts 450792e446 fix embeddableComment field, but still cannot be null and date+user_id are not set...? 2022-01-26 12:07:39 +01:00
julielenaerts ec155b1d67 bug fixed in entity 2022-01-26 12:07:39 +01:00
julielenaerts 02b2af7d51 attempt to make show hide work 2022-01-26 12:07:39 +01:00
julielenaerts 0a6a2c968c all views created for person resource 2022-01-26 12:07:39 +01:00
julielenaerts 4b188e2df6 adjustments to form + rendering of resource kinds 2022-01-26 12:07:39 +01:00
julielenaerts d6bf1988f6 migration adjusted 2022-01-26 12:07:39 +01:00
julielenaerts 94c9505c05 js files put in place + select menus added for selecting person/thirdparty/... show-hide not working yet 2022-01-26 12:07:39 +01:00
julielenaerts 4a5a1440ff form created + general layout of templates 2022-01-26 12:06:44 +01:00
julielenaerts b31cc460fa route and menu entry added in person menu + start of templates/controller 2022-01-26 12:06:44 +01:00
julielenaerts 48c3432191 changelog entry added 2022-01-26 12:06:44 +01:00
julielenaerts 7b4405f6fe entities + migration created 2022-01-26 12:04:16 +01:00
julielenaerts ce3a74326d cs-fixes 2022-01-26 12:01:14 +01:00
julielenaerts 51ab013bd7 violation added if all three association entities are null 2022-01-26 11:20:47 +01:00
Mathieu Jaumotte 41a6366efe vue homepage_widget: improve translations, titles, tabs order, add no data statement 2022-01-26 10:13:58 +01:00
Mathieu Jaumotte c3c2fd30f0 better title proportions 2022-01-25 21:42:04 +01:00
Mathieu Jaumotte 1952e4aa5a render table results for works tab 2022-01-25 21:39:20 +01:00
Mathieu Jaumotte 1e1311b7c8 add counter pills in tabs 2022-01-25 21:09:11 +01:00
Mathieu Jaumotte fc1ed8b71e display table with notifications datas, prepare others tabs to render datas 2022-01-25 20:08:39 +01:00
Mathieu Jaumotte 2144b247b3 store all makeFetch, with isLoaded check 2022-01-25 18:36:54 +01:00
Mathieu Jaumotte e4629ed599 store first makeFetch, with loading spinner 2022-01-25 17:40:08 +01:00
julielenaerts f27dca6fb5 CSfixer changes 2022-01-25 16:41:44 +01:00
julielenaerts 8c27ec0720 Fix user/thirdparty/freetext field in edit form 2022-01-25 16:38:37 +01:00
julielenaerts 8392e2e6bd reorganize templates to fix edit form 2022-01-25 16:09:11 +01:00
julielenaerts 963b0b1ed2 bugfixes in display of dynamicPicker 2022-01-25 16:08:40 +01:00
Pol Dellaiera 7513187a6d Revert "fix cs"
This reverts commit 7b3e9cb490.
2022-01-25 15:54:20 +01:00
Pol Dellaiera 990fc0e484 Remove obsolete file. 2022-01-25 15:50:07 +01:00
Mathieu Jaumotte 8fce27a128 move styles in better place 2022-01-25 15:43:45 +01:00
julielenaerts 55c2c41cea styling changes collapse form 2022-01-25 14:46:09 +01:00
julielenaerts 0bd10b6dfa show-hide files combined into one js file 2022-01-25 14:45:38 +01:00
julielenaerts 8cd01d4317 fix backend error of data transformer 2022-01-25 14:43:51 +01:00
Mathieu Jaumotte 71293e3378 Merge branch '397_homepage' into homepage/rewrite 2022-01-25 14:41:53 +01:00
julienfastre cb58afa44a Merge branch 'master' into homepage/rewrite 2022-01-25 14:40:38 +01:00
julienfastre 7b3e9cb490 fix cs 2022-01-25 14:40:28 +01:00
Mathieu Jaumotte fb720a382f sticky buttons smaller 2022-01-25 14:32:57 +01:00
julienfastre a4bfa1cb16 Merge remote-tracking branch 'origin/master' into homepage/rewrite 2022-01-25 14:28:29 +01:00
Mathieu Jaumotte 502f2aceed init sub-components and active tab mechanism 2022-01-25 13:02:24 +01:00
Pol Dellaiera eb9cc0b63f Update minor things. 2022-01-25 12:19:14 +01:00
Pol Dellaiera 7ee554b48d Update minor things. 2022-01-25 11:56:30 +01:00
Pol Dellaiera 2e6d281bfc cs: Autofix coding standard based on updated rules. 2022-01-25 11:46:29 +01:00
Pol Dellaiera 4b1bf7ce23 Remove obsolete file. 2022-01-25 11:33:14 +01:00
Pol Dellaiera 2d574fea2e chore: Remove duplicate entries from composer.json and normalize it. 2022-01-25 11:29:59 +01:00
Mathieu Jaumotte 0e2772336f create new app vue homepage_widget, with store 2022-01-25 11:27:31 +01:00
Mathieu Jaumotte 320d11671a prepare homepage_widget template 2022-01-25 10:54:08 +01:00
julienfastre 6ef5390a26 update change log with release 2022-01-24 20:00:14 +01:00
julienfastre dec26e2ba4 merge dynamic types 2022-01-24 19:42:06 +01:00
julienfastre 514d75fa5f improve migration 2022-01-24 19:26:16 +01:00
julienfastre 0ac51da31a Merge remote-tracking branch 'origin/issue386_dynamic_type_picker' into issue382_person_resource 2022-01-24 19:23:24 +01:00
julienfastre 90d43b0bd3 Merge remote-tracking branch 'origin/master' into issue382_person_resource 2022-01-24 19:21:06 +01:00
julienfastre 5fe0790912 fix error when creating evaluation 2022-01-24 19:17:04 +01:00
julienfastre ff66aa5590 fix debug message 2022-01-24 15:14:45 +01:00
julienfastre 8e2d3616b5 Merge remote-tracking branch 'origin/master' into issue383_referent_in_acc_course 2022-01-24 15:04:55 +01:00
julienfastre c046824ea3 Merge branch 'issue385_comments_accourse' into 'master'
Bug fix pinned comments parcours

See merge request Chill-Projet/chill-bundles!297
2022-01-24 13:55:50 +00:00
julienfastre a9b216b16b Merge remote-tracking branch 'origin/master' into issue385_comments_accourse 2022-01-24 14:54:00 +01:00
julienfastre f866eae581 Merge branch 'issue347_document_gen_activity' into 'master'
activity: doc gen

See merge request Chill-Projet/chill-bundles!295
2022-01-24 13:51:14 +00:00
juminet 21d4e49fce activity: doc gen 2022-01-24 13:51:14 +00:00
julielenaerts b87f14255d bugfix of double civility abbreviation after edit 2022-01-24 14:44:53 +01:00
julielenaerts 0f2cbbe553 bugfix emit saveFormOnTheFly and add newly created contact to suggestion list immediately 2022-01-24 14:24:56 +01:00
julienfastre 17b887160a Merge branch '105_worflow' into 'master'
105 worflow

See merge request Chill-Projet/chill-bundles!275
2022-01-24 13:17:46 +00:00
Mathieu Jaumotte c7dbaae8d6 105 worflow 2022-01-24 13:17:46 +00:00
nobohan 25ee11e4ff upd CHANGELOG 2022-01-24 13:48:47 +01:00
nobohan df661fc7c4 address: render blur address if confidential in address render box (twig) 2022-01-24 12:13:34 +01:00
nobohan 6b78c06dfb address: use address.confidential in AddressRenderBox.vue 2022-01-24 12:04:23 +01:00
julienfastre daff4e4200 Merge branch 'household/composition-add' into 'master'
Household/composition add + fixes household composition editor

See merge request Chill-Projet/chill-bundles!290
2022-01-24 10:59:00 +00:00
julienfastre 53b3f98bba Household/composition add + fixes household composition editor 2022-01-24 10:59:00 +00:00
julienfastre 2b47868d88 Merge branch 'notification/improve' into 'master'
Improve notifications

See merge request Chill-Projet/chill-bundles!294
2022-01-24 10:09:57 +00:00
julienfastre 54c2b92962 Improve notifications 2022-01-24 10:09:57 +00:00
nobohan d087f051f0 address: remove maxlenght constraint in vuejs form for corridor, flat, steps, floor 2022-01-24 11:08:25 +01:00
nobohan b3edba3abe address: add confidential in vuejs edit form 2022-01-24 11:04:17 +01:00
nobohan 02d8ceba25 address: add confidential in normalizer + code style fix 2022-01-24 10:42:05 +01:00
nobohan 741043c177 address: alter some address field to TEXT + add confidential field 2022-01-24 10:05:47 +01:00
julienfastre c42f62de4c fix phpstan errors: undefined variable or type invalid 2022-01-24 00:32:47 +01:00
julienfastre e23ef35b75 list of unread notificaiton api endpoint 2022-01-24 00:24:20 +01:00
julienfastre eccc75aecf fix cs 2022-01-23 23:22:04 +01:00
julienfastre 7e2fbf93f9 task: api endpoint for my tasks 2022-01-23 23:13:25 +01:00
julienfastre 6ab8f95f7d list of "my evaluation near end" 2022-01-23 22:40:17 +01:00
julienfastre ad05b3bf05 fix variable name in work list page 2022-01-23 22:25:52 +01:00
julienfastre 1faa9812db fix variable name in work list page 2022-01-23 22:24:48 +01:00
julienfastre a786578cbe fix cs 2022-01-23 21:52:27 +01:00
julienfastre c08bd76e4b adding parameter until and since on 'work near end' 2022-01-23 21:52:16 +01:00
julienfastre 20a4950c60 accompanying period work list for my, near end date 2022-01-23 13:23:50 +01:00
julielenaerts cdbae1eade bugfix in parcours display if deathdate of associated person is not defined (ex. for thirdparty) 2022-01-21 17:00:04 +01:00
julielenaerts 45f3bb00d6 php csfixes 2022-01-21 16:50:24 +01:00
julielenaerts 2b9f0e5177 changelog updated 2022-01-21 16:50:09 +01:00
julielenaerts fcf2ae364f all comments are kept when after a second is flagged 2022-01-21 16:47:02 +01:00
julielenaerts 92788ccdc0 php cs-fixes 2022-01-21 15:58:55 +01:00
julielenaerts 84993ca05b update changelog 2022-01-21 15:55:22 +01:00
julielenaerts 972657b38e different dynamic entity picker types created 2022-01-21 15:53:52 +01:00
julielenaerts b26d0905a3 type variable added and file renamed in transformer 2022-01-21 15:01:12 +01:00
julielenaerts 4ab0a28f7d fix phpstan error 2022-01-21 13:05:38 +01:00
julielenaerts 52009bd7c6 show hide functional 2022-01-21 12:35:33 +01:00
julielenaerts 7acd6c7fc3 add placeholders for inputs 2022-01-21 12:34:14 +01:00
julielenaerts f26cba415b fix for comment embeddable null + template adjustments 2022-01-21 12:08:41 +01:00
julielenaerts 8a2e588190 fix embeddableComment field, but still cannot be null and date+user_id are not set...? 2022-01-20 17:14:14 +01:00
julielenaerts d63d9c2f4e bug fixed in entity 2022-01-20 17:13:28 +01:00
julielenaerts dcdee1d6e3 attempt to make show hide work 2022-01-20 17:12:18 +01:00
julielenaerts dd589af1be all views created for person resource 2022-01-20 17:11:51 +01:00
nobohan ce594692b3 accompanying course: confirm DRAFT acc. period when suggestedReferrers is unique or null 2022-01-20 16:59:01 +01:00
nobohan 17076024f7 accompanying course: fix filtering of suggested referrers 2022-01-20 14:27:36 +01:00
nobohan 61607fee3d accompanying course: code fix 2022-01-20 14:14:30 +01:00
nobohan 25ebeebdfb accompanying course: display closed acc. period in list 2022-01-20 08:32:48 +01:00
nobohan 343b2a6f2f accompanying course: re-open: translations + fine-tuning 2022-01-20 08:21:09 +01:00
nobohan d4efe81dbb person: can reopen an accompanying course 2022-01-19 21:46:40 +01:00
nobohan 9d6afc4bb2 accompanying course: close social issues selector on select 2022-01-19 21:04:35 +01:00
julielenaerts 2bdf116698 adjustments to form + rendering of resource kinds 2022-01-19 19:46:01 +01:00
julielenaerts 96dc711b4f migration adjusted 2022-01-19 19:38:57 +01:00
julienfastre c736c2b5bb update changelog 2022-01-19 17:48:46 +01:00
nobohan d1918e4be0 accompanying course: filter referrer by job 2022-01-19 17:48:00 +01:00
julienfastre b3aca957ff Merge remote-tracking branch 'origin/master' into issue377_addFields_toPerson 2022-01-19 17:47:34 +01:00
julienfastre 03bd4d1942 update logic to adapt to altnames 2022-01-19 17:46:27 +01:00
julielenaerts 256c5688a0 attempt to not include parent address 2022-01-19 16:51:21 +01:00
nobohan 040c5f8847 accompanying course: change wording for scopes 2022-01-19 16:18:04 +01:00
nobohan 9b5990916f job in accompanying course: fix error in setting job property 2022-01-19 15:40:38 +01:00
nobohan 74e94637b9 job in accompanying course: validation 2022-01-19 15:40:38 +01:00
nobohan 216c035bac vuejs: add missing translations for multiselect 2022-01-19 15:40:38 +01:00
nobohan 16c86daafb accompanying course: add selector for accompanying course job 2022-01-19 15:40:38 +01:00
nobohan 175fa7bf2f php code fix 2022-01-19 15:40:38 +01:00
nobohan 9f7f6e33e8 user-job: make an endpoint for userJob + doc swagger 2022-01-19 15:40:38 +01:00
nobohan 3471bdec0d accompanyingPeriod: add job 2022-01-19 15:40:38 +01:00
julielenaerts 409cd40460 js code put in seperate file for compilation 2022-01-19 15:37:30 +01:00
julielenaerts 2811e61439 fix filtering of names 2022-01-19 15:13:22 +01:00
julienfastre 2ff34688bb fix validation for notification 2022-01-19 13:59:03 +01:00
julienfastre 8133dd7385 Merge branch 'issue375_dead_persons' into 'master'
person: add obele sign for dead persons

See merge request Chill-Projet/chill-bundles!292
2022-01-19 11:23:52 +00:00
juminet 256dab3739 person: add obele sign for dead persons 2022-01-19 11:23:51 +00:00
julienfastre 532a751509 Merge branch 'issue381_address_in_location' into 'master'
address in location

See merge request Chill-Projet/chill-bundles!289
2022-01-19 11:22:33 +00:00
juminet f0a7565302 [location] fix address saving in admin form 2022-01-19 11:22:33 +00:00
julielenaerts 6460007aa1 changelog updated 2022-01-19 12:18:09 +01:00
julielenaerts f84e088e7b placeholders for civility and profession 2022-01-19 12:14:37 +01:00
julienfastre 64c4f1ece2 Merge branch 'issue374_documents_in_activity_bug' into 'master'
Issue374 documents in activity bug

See merge request Chill-Projet/chill-bundles!287
2022-01-19 10:59:44 +00:00
juminet ad983d80d2 Issue374 documents in activity bug 2022-01-19 10:59:44 +00:00
julielenaerts b8e16d2929 correction for POST phonenumber and email 2022-01-19 11:06:07 +01:00
julielenaerts 88fc5e94fa only show addcontact button for personne morale 2022-01-19 11:00:53 +01:00
julielenaerts 4431428c26 possible to add a contact to a thirdparty 2022-01-19 10:57:31 +01:00
julielenaerts 724ce8c9af small corrections 2022-01-19 09:57:19 +01:00
julielenaerts 001e2f9622 js files put in place + select menus added for selecting person/thirdparty/... show-hide not working yet 2022-01-19 09:48:39 +01:00
julielenaerts 58ac4b01ef form created + general layout of templates 2022-01-18 14:54:03 +01:00
julielenaerts 6e4bfd45c6 route and menu entry added in person menu + start of templates/controller 2022-01-18 13:55:09 +01:00
julielenaerts ff0b0678a5 changelog entry added 2022-01-18 11:11:29 +01:00
julielenaerts 3b56cc818b entities + migration created 2022-01-18 11:08:24 +01:00
julielenaerts 21d5f974eb advanced search possible 2022-01-18 10:20:45 +01:00
julielenaerts 59b2b07a21 space added between deathdate and age + changelog updated 2022-01-17 18:04:43 +01:00
julielenaerts eaf9f72fdd lastname added in uppercase 2022-01-17 16:34:54 +01:00
julielenaerts 169442decc changelog updated 2022-01-17 16:29:46 +01:00
julielenaerts cf8e25e823 search parameter also passed on in normal list template 2022-01-17 16:26:51 +01:00
julielenaerts 96b1f31665 javascript added to easily fill in form fields with name elements 2022-01-17 16:24:35 +01:00
julienfastre 2ad798c0bf Merge branch 'master' into notification_finitions 2022-01-17 15:29:48 +01:00
julienfastre 7e932e838f Squashed commit of the following:
commit 9e767fa3e0788d87437c235e51fcdc4f26f75d98
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Jan 17 15:28:02 2022 +0100

    traductions

commit db65134743
Author: nobohan <juminet@gmail.com>
Date:   Mon Jan 17 12:17:22 2022 +0100

    add person: increase z-index of toast and wait for validation before closing modal

commit 7af4c3434e
Merge: a09c8ee8a 46c6d0e29
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Jan 16 22:51:45 2022 +0100

    Merge remote-tracking branch 'origin/master' into issue357_front_end_validation

commit a09c8ee8af
Author: nobohan <juminet@gmail.com>
Date:   Wed Jan 12 15:47:11 2022 +0100

    upd CHANGELOG

commit a312a9463d
Author: nobohan <juminet@gmail.com>
Date:   Wed Jan 12 15:29:32 2022 +0100

    address: display error message if some fields are empty (street & streetnumber)

commit 0035128138
Author: nobohan <juminet@gmail.com>
Date:   Wed Jan 12 14:47:43 2022 +0100

    address: display error message if some fields are empty

commit 49cb154672
Author: nobohan <juminet@gmail.com>
Date:   Tue Jan 11 20:58:00 2022 +0100

    address: add field validation (WIP)

commit 1a7ec9e396
Author: nobohan <juminet@gmail.com>
Date:   Tue Jan 11 17:16:43 2022 +0100

    Activity: fix vuejs warning

commit fa0b9271c2
Author: nobohan <juminet@gmail.com>
Date:   Tue Jan 11 16:13:23 2022 +0100

    location: treat 422 error when POSTing new location

commit c7b9a1a3fe
Author: nobohan <juminet@gmail.com>
Date:   Tue Jan 11 16:00:29 2022 +0100

    location: fix error when creating a new location: a new location could not be added to the availableLocations due to refactoring

commit f1c61a2387
Author: nobohan <juminet@gmail.com>
Date:   Tue Jan 11 15:20:33 2022 +0100

    person: treat 422 error in AddPerson for thirdparty

commit 8f6a70b240
Author: nobohan <juminet@gmail.com>
Date:   Tue Jan 11 11:30:05 2022 +0100

    person: add validation for required fields in on-the-fly person

commit 40e4bf953f
Author: nobohan <juminet@gmail.com>
Date:   Tue Jan 11 09:34:15 2022 +0100

    vuejs: better violations message in 422 error handling

commit 378f3a16fc
Author: nobohan <juminet@gmail.com>
Date:   Mon Jan 10 18:11:02 2022 +0100

    person: on-the-fly person: first implementation of makeFetch for posting person
2022-01-17 15:28:49 +01:00
julielenaerts 41354097f3 order of form fields changed 2022-01-17 14:25:28 +01:00
julielenaerts 9a3f35703b parameter passed to person creation page 2022-01-17 14:24:46 +01:00
julielenaerts 5423de3bd9 fields added to person creation form 2022-01-17 14:23:54 +01:00
julielenaerts 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
julienfastre 5e3d421b56 remove the possibility to generate a document from accompanying period work 2022-01-16 23:59:02 +01:00
julienfastre 71ca033b08 Merge branch 'issue363_localisation_type_not_available_to_users' into 'master'
localisation type not available to edit by users

See merge request Chill-Projet/chill-bundles!282
2022-01-16 22:51:29 +00:00
juminet 2c774e814e localisation type not available to edit by users 2022-01-16 22:51:29 +00:00
julienfastre 3034ba411f [course list in person context] show renderbox for referent 2022-01-16 23:39:47 +01:00
julienfastre ce6e51df87 Merge branch 'issue341_user_main_location' into 'master'
[main] Add mainLocation field to User entity

See merge request Chill-Projet/chill-bundles!283
2022-01-16 22:36:55 +00:00
juminet 6843b4cb2a [main] Add mainLocation field to User entity 2022-01-16 22:36:55 +00:00
julienfastre dcbce270ad Merge branch 'issue376_internal_activityType_display' into 'master'
Display of activity types

See merge request Chill-Projet/chill-bundles!286
2022-01-16 22:18:16 +00:00
LenaertsJ 3f5a6c6b15 Display of activity types 2022-01-16 22:18:16 +00:00
Mathieu Jaumotte d806551477 notification, list item: manage option fold_item with macro 2022-01-15 20:33:31 +01:00
Mathieu Jaumotte 120ce40dbe notification list: use bootstrap accordion to fold/unfold notification content 2022-01-15 17:13:20 +01:00
Mathieu Jaumotte 22022e5143 JS toggle class read/unread status works on *all* container (change DOM selector) 2022-01-14 20:02:00 +01:00
julielenaerts 47615e2e5d merge conflicts fixed 2022-01-14 16:13:35 +01:00
julielenaerts 46c6d0e293 minor fix: } missing in template causing an error 2022-01-14 15:25:17 +01:00
Mathieu Jaumotte 20fcaa5428 notification: add prefix in object 2022-01-14 15:03:36 +01:00
julielenaerts bb0a04b19a Using translations instead of hardcoded 2022-01-14 14:37:50 +01:00
julielenaerts 8d3ba314e0 adjustment badges into rounded-pill + red color for urgent 2022-01-14 14:18:37 +01:00
julielenaerts 9e48a1db0a badges added in list view for parcours that are urgent and/or confidential 2022-01-14 13:58:56 +01:00
julielenaerts 475585c5e7 use correct button 2022-01-14 09:30:00 +01:00
Mathieu Jaumotte a2e086be75 add a chill button "tpchild", to create on-the-fly thirdparty (kind=child) 2022-01-14 09:30:00 +01:00
julielenaerts e6cf1994b0 parent id added to thirdparty data 2022-01-14 09:30:00 +01:00
julielenaerts 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
julielenaerts 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
julielenaerts c4a859f2d2 translations added 2022-01-14 09:27:36 +01:00
julielenaerts a39bd79930 endpoints created for profession and civility for use in vue component 2022-01-14 09:27:06 +01:00
julielenaerts 424d0533b8 unsaved changes 2022-01-14 09:27:06 +01:00
julielenaerts 5a7d187a10 unsaved changes 2022-01-14 09:27:06 +01:00
julielenaerts 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
julielenaerts 006e8cdc27 minor bug fix for view page of thirdparty property 'types' -> 'thirdPartyTypes' 2022-01-14 09:27:06 +01:00
Mathieu Jaumotte 819017112d JS toggle class read/unread when clicking on vue component NotificationReadToggle.vue 2022-01-13 18:56:07 +01:00
julielenaerts cf4f6f06e9 use correct button 2022-01-13 17:58:30 +01:00
Mathieu Jaumotte e467820345 add a chill button "tpchild", to create on-the-fly thirdparty (kind=child) 2022-01-13 17:53:32 +01:00
julielenaerts 416a1c4e4d parent id added to thirdparty data 2022-01-13 16:36:54 +01:00
julielenaerts 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
Mathieu Jaumotte d7d7fb5693 add a chill button "tpchild", to create on-the-fly thirdparty (kind=child) 2022-01-13 16:15:49 +01:00
Mathieu Jaumotte 650e0d79be improve notification list and show styles 2022-01-13 15:40:41 +01:00
julielenaerts a288fdf12d resolve merge conflict 2022-01-13 14:40:37 +01:00
julielenaerts 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
julielenaerts 3860adc435 translations added 2022-01-13 14:34:28 +01:00
julielenaerts 65daf2d0cf endpoints created for profession and civility for use in vue component 2022-01-13 14:33:57 +01:00
Mathieu Jaumotte 0afccd12a9 fix error when twig insert onthefly with parent undefined 2022-01-13 14:11:53 +01:00
Mathieu Jaumotte 7abe3e1b2d chill-no-data-statement smaller (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/354) 2022-01-13 14:11:08 +01:00
Mathieu Jaumotte 6c71cb0e80 Merge branch '232_resources_comment' into 'master'
232 resources comment

See merge request Chill-Projet/chill-bundles!276
2022-01-13 11:05:15 +00:00
Mathieu Jaumotte 11d4450244 fix condition to show comment in on-the-fly 2022-01-13 11:27:36 +01:00
julienfastre 5a79df0e0a fix test 2022-01-12 22:34:32 +01:00
julienfastre c0c2131be0 fix notification test 2022-01-12 22:22:18 +01:00
Mathieu Jaumotte e6ea2674c2 comment console.log, remove v-bind before ':' 2022-01-12 22:13:14 +01:00
julienfastre 39b5ce0320 fix access to database in ci 2022-01-12 22:06:47 +01:00
Mathieu Jaumotte e0ee817421 batch rename twig attribut 2022-01-12 21:36:12 +01:00
julienfastre 8159144f26 fix accesss to database on ci 2022-01-12 20:20:20 +00:00
Mathieu Jaumotte 630115fd3a update changelog 2022-01-12 20:43:17 +01:00
Mathieu Jaumotte 87cf8d737e remove dump 2022-01-12 20:38:09 +01:00
Mathieu Jaumotte ecda740d81 on-the-fly: add a 'parent' option to pass parent context. So we could now display resource.comment below the renderbox. 2022-01-12 20:26:54 +01:00
Mathieu Jaumotte c9e3960238 clean commented unused code 2022-01-12 17:55:00 +01:00
julielenaerts 9bf41bbd34 unsaved changes 2022-01-12 17:41:58 +01:00
julielenaerts de7de22492 unsaved changes 2022-01-12 17:40:36 +01:00
julielenaerts 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
Mathieu Jaumotte 782e098e31 Course resume page: hide a masonry bloc if no content (fix) 2022-01-12 17:37:49 +01:00
Mathieu Jaumotte 34ff91979b emit response and commit change in store 2022-01-12 17:06:21 +01:00
Mathieu Jaumotte abcc8557ce resources: add a WriteComment new subcomponent 2022-01-12 15:25:06 +01:00
julielenaerts c1232037a9 minor bug fix for view page of thirdparty property 'types' -> 'thirdPartyTypes' 2022-01-12 13:52:26 +01:00
julielenaerts 15342f85d3 only show current participations in parcours resumé 2022-01-12 13:39:53 +01:00
julielenaerts b679d833da display location type between parentheses for actions 2022-01-12 13:37:04 +01:00
julielenaerts f8ca349d9e use renderbox to display referrer in action list item 2022-01-12 12:10:41 +01:00
julielenaerts a8978a52b9 blur effect added on requestor if marked as anonymous 2022-01-12 12:05:45 +01:00
Mathieu Jaumotte b1bffd875c Undo 'add thirdparty comment in acccourse resources' (commit 62b8b3e6)
-> it was displaying wrong comment !
2022-01-12 11:19:57 +01:00
Mathieu Jaumotte b23161fa1d Merge branch 'master' into 232_resources_comment 2022-01-12 10:11:39 +01:00
Mathieu Jaumotte e540baaa4f fix condition when confirming delete action 2022-01-12 10:09:42 +01:00
julienfastre 9fe744f09f thirdparty docgen normalizer: fix return type for telephone 2022-01-12 09:39:15 +01:00
julienfastre 6b1310148f notification: fix test 2022-01-11 11:24:11 +01:00
julienfastre 1650f30a59 upgrade app 2022-01-11 11:22:46 +01:00
julienfastre f6386a13ac fix cs 2022-01-11 11:05:42 +01:00
Mathieu Jaumotte e437705714 composer deps symfony/mime, change version 2022-01-11 10:29:00 +01:00
Mathieu Jaumotte f79225fc2b Merge branch 'master' into notification/completion 2022-01-11 10:18:02 +01:00
julienfastre 7564c2fde1 AccompanyingPeriodResource: add ACL 2022-01-10 23:12:52 +01:00
julienfastre 2c4d06371c AccompanyingPeriodResource: fix deserialization + code style 2022-01-10 23:08:23 +01:00
julienfastre 8e012982f5 Merge remote-tracking branch 'origin/master' into 232_resources_comment 2022-01-10 21:56:36 +01:00
julienfastre ba893e8429 Merge branch '327_pinned_comment' into 'master'
327 pinned comment

See merge request Chill-Projet/chill-bundles!279
2022-01-10 20:55:37 +00:00
Mathieu Jaumotte b153fc19f6 327 pinned comment 2022-01-10 20:55:37 +00:00
julienfastre 098c2fbaa0 Merge remote-tracking branch 'origin/master' into 232_resources_comment 2022-01-10 21:50:00 +01:00
Mathieu Jaumotte 479e4ffe64 add notification box in context person, page show activity 2022-01-10 17:08:56 +01:00
Mathieu Jaumotte 42a14fbd6b AccompanyingPeriod list: manage context entity variable in record_actions buttons (TO BE CHECKED)
Need to pass context entity in record_actions buttons to use variables like 'person' !
2022-01-10 16:55:01 +01:00
Mathieu Jaumotte 46ca74fc70 Merge branch 'master' into notification/completion 2022-01-10 16:11:06 +01:00
Mathieu Jaumotte ae931b5869 update changelog 2022-01-10 16:04:04 +01:00
Mathieu Jaumotte fded08aaaa include Activity in notification (ShowInNotification) 2022-01-10 16:01:22 +01:00
Mathieu Jaumotte d60938352b notification: add selector on title, move styles 2022-01-10 15:59:36 +01:00
Mathieu Jaumotte af6f3043ae activity list page: put item bloc in a separate include 2022-01-10 15:58:11 +01:00
Mathieu Jaumotte 8afd1ee275 Activity show page: move notify button and notification-box in post menu area 2022-01-10 15:14:50 +01:00
Mathieu Jaumotte 5a739380cd force ShowInNotification background (for odd gray container) 2022-01-10 14:36:58 +01:00
Mathieu Jaumotte a1ec2b637d ShownInNotification: put border on alert block 2022-01-10 14:36:27 +01:00
Mathieu Jaumotte 584b77bbf4 accourse resume page: fix masonry block border 2022-01-10 14:36:27 +01:00
Mathieu Jaumotte e84182cdac translations + alert message position 2022-01-10 13:08:09 +01:00
julienfastre 01d51da7e1 Merge branch 'issue344_vue_multiselect_i18n' into 'master'
Issue344 vue multiselect i18n

See merge request Chill-Projet/chill-bundles!278
2022-01-10 12:04:57 +00:00
juminet 699dcc85de Issue344 vue multiselect i18n 2022-01-10 12:04:57 +00:00
julienfastre e677c0fe2f Merge branch 'issue309_address_lines' into 'master'
address: render Address as lines

See merge request Chill-Projet/chill-bundles!277
2022-01-10 11:49:38 +00:00
juminet edeaaf0218 address: render Address as lines 2022-01-10 11:49:38 +00:00
Mathieu Jaumotte afae3b58c2 notification form integration (create/edit) 2022-01-10 12:44:08 +01:00
Mathieu Jaumotte 95027e93c6 fix translations for AddPersons in PickEntity 2022-01-10 12:41:47 +01:00
julienfastre a3ea28d307 Merge branch 'issue342_location_in_acc_period' into 'master'
accompanying period: add location to accompanying period + add delete button

See merge request Chill-Projet/chill-bundles!272
2022-01-10 11:03:14 +00:00
juminet 921dd639bf accompanying period: add location to accompanying period + add delete button 2022-01-10 11:03:14 +00:00
Mathieu Jaumotte a40077e91b include AccompanyingPeriod in notification (shownInNotification) 2022-01-10 10:52:09 +01:00
julienfastre 8de5c8900a Merge branch 'docgen/action-add-missing-goals' into 'master'
Docgen/action add missing goals

See merge request Chill-Projet/chill-bundles!280
2022-01-10 09:35:26 +00:00
julienfastre efc3e3915b Docgen/action add missing goals 2022-01-10 09:35:26 +00:00
Mathieu Jaumotte 98ab3b66ba Accompanying periods list: move item in separate template (to share) 2022-01-10 10:21:31 +01:00
Mathieu Jaumotte b1cd85971a notification show page: use macro to display thread comments 2022-01-07 15:50:47 +01:00
Mathieu Jaumotte 0a3b50568d Merge branch '327_pinned_comment' into notification/completion 2022-01-07 15:25:54 +01:00
Mathieu Jaumotte 69b5c98d2e inject record_actions buttons inside macro 2022-01-07 15:24:06 +01:00
Mathieu Jaumotte 5c4bef26e8 hotfix typo in NotificationComment 2022-01-07 14:56:17 +01:00
Mathieu Jaumotte bdf4b71080 Merge branch '327_pinned_comment' into notification/completion 2022-01-07 13:02:59 +01:00
Mathieu Jaumotte c60d46c68b put macro show_comment in a separate template 2022-01-07 12:51:03 +01:00
Mathieu Jaumotte be4b8a94f0 AccompanyingCourse comments: move and rename files 2022-01-07 12:37:19 +01:00
Mathieu Jaumotte a54cc70fd6 temporary disable previous commit 2022-01-07 12:34:14 +01:00
Mathieu Jaumotte 18959f60e2 reuse notification item in show template 2022-01-06 19:42:45 +01:00
Mathieu Jaumotte 7d4ca8d149 remove dropped tests, separate list item in external include 2022-01-06 19:04:24 +01:00
Mathieu Jaumotte 442e2a1ede notification list, item header integration (test 3 ways) 2022-01-06 19:04:24 +01:00
Mathieu Jaumotte c32b767d9b Notifications list template 2022-01-06 19:04:16 +01:00
Mathieu Jaumotte 140f53b81f setting NotificationReadToggle options for several cases. improve options 2022-01-06 13:34:39 +01:00
Mathieu Jaumotte b9e5734039 bouton bleu 2022-01-05 21:16:47 +01:00
Mathieu Jaumotte f5f5d66f3d design notification box in post menu area 2022-01-05 20:58:51 +01:00
Mathieu Jaumotte 1e0c62b09d Merge branch 'master' into notification/completion 2022-01-05 11:15:49 +01:00
julienfastre 78cf817921 docgen: add location to accompanying period 2022-01-04 23:50:22 +01:00
julienfastre 40a457ba69 notificaiton: add mailer component 2022-01-04 22:41:17 +01:00
julienfastre 66aac8908c notification: fix translations 2022-01-04 22:41:04 +01:00
julienfastre c17fd968be notification: do not show system notification in UI 2022-01-04 22:40:48 +01:00
julienfastre 6f561f57a6 Notification: send an email when a notification is created 2022-01-04 22:35:23 +01:00
Mathieu Jaumotte 4f1540c541 add a patch resource api endpoint (wip) 2022-01-04 19:37:27 +01:00
julienfastre 4ef024516c notificaiton: improve NotificationHandlerInterface + mark notification
as unread if a comment is appended
2022-01-04 19:02:03 +01:00
julienfastre ebc6d21ba6 notification: order notification by date desc in inbox and sent 2022-01-04 18:38:08 +01:00
julienfastre d31661ae7a notification: fix NotificationHandlerInterface 2022-01-04 17:55:34 +01:00
julienfastre f76f7a1641 notification: handle activities 2022-01-04 17:40:47 +01:00
Pol Dellaiera f63afea2ce Autofix code style. 2022-01-04 17:32:05 +01:00
Pol Dellaiera 660e45ac59 tests: Tag failing test as incomplete. 2022-01-04 17:27:30 +01:00
Pol Dellaiera e619e58a6e tests: Tag failing test as incomplete. 2022-01-04 17:20:25 +01:00
julienfastre 160d382e07 notification: add notification sent to widget which list notifications
ont an entity
2022-01-04 17:14:09 +01:00
julienfastre a8fe049ecd notification: add more variable in twig template 2022-01-04 17:00:31 +01:00
julienfastre 3a207b2c5d Notification: add a counter for notifications 2022-01-04 16:44:01 +01:00
Pol Dellaiera 08de360677 tests: Tag failing test as incomplete. 2022-01-04 16:38:21 +01:00
Pol Dellaiera e2ad590310 tests: Get rid of PHPUnit deprecations. 2022-01-04 16:29:49 +01:00
Pol Dellaiera 6ebcd87508 tests: Replace assertInternalType with proper method.
See https://github.com/sebastianbergmann/phpunit/issues/3369
2022-01-04 16:21:06 +01:00
nobohan 06f8014b76 Merge branch 'master' into issue303_household_fixes 2022-01-04 16:06:15 +01:00
nobohan 52f817bde7 fix conflicts when merging master 2022-01-04 15:56:32 +01:00
Mathieu Jaumotte af2eca0d03 Change accompanyingCourse Resources comment by a string 2022-01-04 15:56:00 +01:00
Pol Dellaiera 33913867ee cs: Use Collection more and fix potential duplicates. 2022-01-04 15:55:56 +01:00
julienfastre bcd25fa950 Merge branch 'issue349-masonry' into 'master'
Issue349 masonry

See merge request Chill-Projet/chill-bundles!274
2022-01-04 14:38:04 +00:00
Pol Dellaiera acf7142bad cs: Use Collection more. 2022-01-04 15:29:17 +01:00
Pol Dellaiera c8c5af8d14 cs: Update PersonJsonNormalizer. 2022-01-04 15:18:03 +01:00
nobohan aa6b770bfe fix conflict 2022-01-04 15:11:43 +01:00
nobohan 4d5d5265df fix alt name choice array 2022-01-04 15:10:03 +01:00
Pol Dellaiera d19c5c9e41 cs: Autofix. 2022-01-04 15:07:41 +01:00
Pol Dellaiera cf588c97c0 cs: Autofix. 2022-01-04 14:41:52 +01:00
Pol Dellaiera f3f5cc550c sa: Fix PHPStan issue. 2022-01-04 14:41:52 +01:00
Pol Dellaiera c7d00ca937 chore: Optimize composer.json. 2022-01-04 14:41:52 +01:00
nobohan e3c0dca1d1 upd CHANGELOG 2022-01-04 14:39:43 +01:00
nobohan f4c8d0b09a Merge remote-tracking branch 'origin/master' into issue230_person 2022-01-04 13:50:27 +01:00
Mathieu Jaumotte 68ea0a1086 wip delete comment 2022-01-04 12:07:37 +01:00
julienfastre 5bb5468198 notificaiton: add title to list and forms 2022-01-04 11:32:15 +01:00
Mathieu Jaumotte 5fead5b467 fix translation, disable throw exception 2022-01-04 11:18:56 +01:00
Pol Dellaiera 72a15bb823 chore: Update composer.json. 2022-01-04 11:15:13 +01:00
julienfastre 0edd5667e0 fix cs 2022-01-04 11:09:59 +01:00
Mathieu Jaumotte 862f9aefb0 update changelog 2022-01-04 10:27:28 +01:00
julienfastre 45dd21e02a add component and type to add user dynamically 2022-01-03 15:42:24 +01:00
julienfastre 5bf1b9d8bd send system notification on period confirmation 2021-12-30 02:11:21 +01:00
julienfastre 7bc4ad9779 twig extension for listing notification on a given entity 2021-12-30 01:02:16 +01:00
julienfastre 1576507f7e notification: fix widget toggle read status 2021-12-29 23:09:26 +01:00
julienfastre 9ddfd194be notification: small vue component to toggle read status of a notification 2021-12-29 18:51:25 +01:00
julienfastre 8fe94bd117 notification: update comment and api endpoint for marking as read/unread 2021-12-29 17:36:14 +01:00
julienfastre 9d638fe897 allow to edit notification 2021-12-29 15:24:52 +01:00
julienfastre 478c3b3247 notification: add update information 2021-12-29 15:12:27 +01:00
Mathieu Jaumotte dc581fcf57 fix details and corrections 2021-12-29 15:06:33 +01:00
Mathieu Jaumotte bd909b0061 fix details and corrections 2021-12-29 14:57:18 +01:00
julienfastre 58c7560a1c Merge remote-tracking branch 'origin/notification/completion' into notification/completion 2021-12-29 14:46:55 +01:00
Mathieu Jaumotte 9e67d9586d masonry: add origin bloc 2021-12-29 12:32:19 +01:00
Mathieu Jaumotte 982dd78828 put back warnings inside condition 2021-12-29 12:15:21 +01:00
Mathieu Jaumotte 1055fd9398 masonry: raise comment bloc width 2021-12-29 12:13:39 +01:00
Mathieu Jaumotte 5089bba4d7 improve masonry bloc style 2021-12-29 12:11:20 +01:00
Mathieu Jaumotte 433307020a add a new button to send notifications 2021-12-29 10:52:15 +01:00
julienfastre 5a5ff5f54a notification: fix type for id 2021-12-28 23:32:11 +01:00
julienfastre a0b112e8db notificaiton: handle remove addressee and reset at the end of registering unread 2021-12-28 23:31:33 +01:00
julienfastre cb88a37885 notification: add comment in show and append comment 2021-12-28 23:25:12 +01:00
julienfastre 9647785d8b notificaton: add comments 2021-12-28 23:03:58 +01:00
julienfastre 1ad6a958e2 notification: add show action 2021-12-28 22:35:15 +01:00
julienfastre f453dbb543 notification: more check in test 2021-12-28 20:04:30 +01:00
julienfastre b323ddae05 fix loading of unread addressees in notification 2021-12-28 19:40:38 +01:00
julienfastre d5d64cdf65 upgrade test app 2021-12-26 01:12:42 +01:00
julienfastre 700bb02374 notification: add test for unread consistency 2021-12-26 01:12:32 +01:00
julienfastre bd3919efcb notification: store users which are unread instead of read, and in
dedicated table

The query "which are the unread notification" is much more frequent than
the read one. We then store the unread items in a dedicated table.
2021-12-26 01:00:50 +01:00
julienfastre f6f0786d38 notificaiton: load interface automatically 2021-12-25 22:53:35 +01:00
julienfastre 5cebcfddb7 fix cs ? 2021-12-25 22:51:58 +01:00
julienfastre 11824adda4 notification: create 2021-12-25 22:41:25 +01:00
julienfastre d62893827b create a notification controller 2021-12-25 22:16:34 +01:00
julienfastre e972beee11 fix controller loading and add UserMenu entry 2021-12-25 20:47:54 +01:00
Pol Dellaiera 6a0ce72836 tests: Remove @expectException annotation. 2021-12-21 16:22:31 +01:00
Pol Dellaiera f93b1935ee ci: Update PHPUnit behavior. 2021-12-21 16:14:27 +01:00
Pol Dellaiera 64ec3e62da ci: Update PHPUnit behavior. 2021-12-21 15:52:47 +01:00
Pol Dellaiera 492d5caaf0 fix: Fix return types in tests. 2021-12-21 15:39:09 +01:00
Pol Dellaiera 2ed3a91d8e fix: Fix return types in tests. 2021-12-21 15:32:58 +01:00
Pol Dellaiera b55c19cd9e fix: Fix return types in tests. 2021-12-21 15:26:22 +01:00
Pol Dellaiera 70ca203e23 fix: Fix return types in tests. 2021-12-21 15:19:36 +01:00
Pol Dellaiera 58a13d932f fix: Fix return types in tests. 2021-12-21 15:12:15 +01:00
Pol Dellaiera 11c6f6d84a Fix code-style. 2021-12-21 15:02:43 +01:00
Pol Dellaiera 3d0be940f0 fix: Fix return types in tests. 2021-12-21 15:02:12 +01:00
Pol Dellaiera ea839a4b52 fix: Add missing UUID doctrine type. 2021-12-21 14:54:37 +01:00
Mathieu Jaumotte 793f7724a7 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-12-21 14:44:50 +01:00
Mathieu Jaumotte 40e7bfef4d Merge branch 'design_corrections' 2021-12-21 14:44:23 +01:00
Pol Dellaiera d692793714 fix: Add missing UUID doctrine type. 2021-12-21 14:31:31 +01:00
Pol Dellaiera 01ef9617d6 chore: Require symfony/serializer ^5.3 because we are using Serialization contexts. 2021-12-21 12:23:10 +01:00
Pol Dellaiera 530ad497bc cs: Fix code-style. 2021-12-21 12:13:20 +01:00
Pol Dellaiera e2bc868495 sa: Update PSalm baseline. 2021-12-21 12:05:36 +01:00
Pol Dellaiera b743475761 sa: Fix all issues related to PHP versions and static-analysis. 2021-12-21 11:58:58 +01:00
Pol Dellaiera b3823161af fix: Do not use deprecated classes. 2021-12-21 11:18:17 +01:00
Pol Dellaiera beeb69c70d chore: Update composer.json
Restrict to PHP 7.4.
Fix versions of packages using branches.
2021-12-21 11:15:19 +01:00
Pol Dellaiera 8401ce2656 cs: Fix code-style (using PHPCSFixer and PHPCS). 2021-12-21 10:59:23 +01:00
Pol Dellaiera b7360955f7 chore: Relax dependencies for faster composer install. 2021-12-21 10:52:14 +01:00
Pol Dellaiera 8c3fb6dfa7 Merge branch 'feat/add-psalm-checks' 2021-12-21 10:15:34 +01:00
Pol Dellaiera c84ba5371d test: Do not use PHP 8 keywords yet.
It's much too early ! :)
2021-12-21 10:06:18 +01:00
Pol Dellaiera 4d9c643977 test: Add psalm checks. 2021-12-21 09:59:20 +01:00
Mathieu Jaumotte f117dcd703 objective-result-eval: display as a table in lists and dashboards 2021-12-20 15:46:07 +01:00
Mathieu Jaumotte 67c1760b51 fix bootstrap class 2021-12-20 13:53:49 +01:00
Mathieu Jaumotte 97792fd85f Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-12-20 12:58:35 +01:00
Mathieu Jaumotte ae43e23ec6 Merge branch 'master' into issue321_layout_improvements_actionForm 2021-12-20 12:56:41 +01:00
Mathieu Jaumotte 6a4d7fbece AccompanyingCourseWorkEdit: fix bug, remove goal one by one
(adding a temporary negative index on just created goals)
2021-12-20 12:52:29 +01:00
Mathieu Jaumotte 1a0dcfa8d0 Merge branch 'issue265' 2021-12-17 16:20:15 +01:00
Mathieu Jaumotte 66f407ab8c filiation: fix 265 https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/265 2021-12-17 16:19:28 +01:00
Mathieu Jaumotte c7e992fd1a rename title (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/177) 2021-12-17 11:51:44 +01:00
Mathieu Jaumotte 3d16f68f54 accompanyingcourse-work: improve ui 2021-12-17 08:16:39 +01:00
julienfastre 36890a2256 person document: fix use of deprecated role class 2021-12-17 00:33:02 +01:00
Mathieu Jaumotte 395920bd51 suggest-list: picto is managedby css 2021-12-17 00:22:20 +01:00
julienfastre 773aee5534 address reference: add index for refid 2021-12-16 22:41:37 +01:00
Mathieu Jaumotte a6cc6221d6 restore badge-title appearance 2021-12-16 22:35:47 +01:00
Mathieu Jaumotte 37ed6b7591 revert some scss conflicts with suggest-list 2021-12-16 22:18:17 +01:00
julienfastre cdc335372f person denormalization: use object to populate if any 2021-12-16 22:02:00 +01:00
julienfastre e0bed186b8 normalization of date: allow null 2021-12-16 22:01:35 +01:00
Mathieu Jaumotte d588c36308 Merge branch '327_pinned_comment' into issue321_layout_improvements_actionForm 2021-12-16 21:41:22 +01:00
julienfastre 06cbe8325c fix person validation 2021-12-16 21:39:59 +01:00
julienfastre 400ce3ac82 remove dead code 2021-12-16 21:28:53 +01:00
julienfastre 14aab637eb start to simplify validation groups for person 2021-12-16 21:23:40 +01:00
julienfastre 6296c7a307 household/address: show date validFrom and validTo when moving Household 2021-12-16 21:23:40 +01:00
julienfastre b613a2f49b holder: fix when repositionning/moving member on same day
* if holder has not the index '0', validator fails. Use the method
Collection::first
* change constraint to allow a move on household on same day
2021-12-16 21:23:34 +01:00
Mathieu Jaumotte 91bee4aad3 wip goal-result on resume page 2021-12-16 18:55:21 +01:00
Mathieu Jaumotte 45b71b207e activity fix: display comment in list 2021-12-16 13:58:43 +01:00
julielenaerts 751a418c1f Update changelog 2021-12-16 10:42:02 +01:00
julielenaerts 8cf08f66d5 Fix bug in singleTaskController 2021-12-16 10:41:51 +01:00
julielenaerts b7c0548212 Fix style of dropdown menu 2021-12-16 10:41:36 +01:00
julienfastre 408a14926f Merge branch 'docgen/add-base-context' 2021-12-15 23:52:51 +01:00
julienfastre efdd96b69f docgen: person normalization: fix typing of age 2021-12-15 23:51:41 +01:00
julienfastre 10ebf0b63a Merge branch 'docgen/add-base-context' into 'master'
Docgen/add base context

See merge request Chill-Projet/chill-bundles!270
2021-12-15 22:43:06 +00:00
julienfastre d4a5735e15 Docgen/add base context 2021-12-15 22:43:06 +00:00
julienfastre 9453fc2dd5 docgen: add age and base context 2021-12-15 23:42:37 +01:00
Mathieu Jaumotte f01b87b348 comments: form controller 2021-12-15 23:34:41 +01:00
julienfastre 689f612382 fix cs 2021-12-15 23:05:37 +01:00
julienfastre 17a81d7e66 build base context data 2021-12-15 23:05:25 +01:00
julienfastre 6501a0148e fix downloading document 2021-12-15 22:14:20 +01:00
julienfastre 44d38bcef5 fix typing for email 2021-12-15 22:14:20 +01:00
julienfastre 75dda5b999 userpicker: fix role type: adapt on both allowed types 2021-12-15 22:14:20 +01:00
julienfastre 46ecab24c2 update changelog 2021-12-15 22:14:20 +01:00
julienfastre 45c608cd48 AddPerson: optimize request while searching
* wait for a person to finish to type: delay before launching request;
* cancel previous requests, if any
2021-12-15 22:14:20 +01:00
julielenaerts ecbe30ae53 person create button style changed to full width + update changelog 2021-12-15 14:21:31 +01:00
Mathieu Jaumotte 4e8492db70 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-12-15 00:15:24 +01:00
Mathieu Jaumotte 48f62a2a17 refund template design for person household_history 2021-12-15 00:14:31 +01:00
julienfastre decc74c040 Merge branch 'issue332_location_activity' into 'master'
fix: add availableForUsers condition from locationType in the location API endpoint

See merge request Chill-Projet/chill-bundles!264
2021-12-14 22:28:09 +00:00
julienfastre de790d11a8 activity/location: refactor
Refactor the way for loading locations:

* fix showing the default location
* fix when there is not thirdparty default location
* separate api queries instead of inlines;
* use the store instead of the mounted
* refactored for a possible re-use in calendar
2021-12-14 23:20:47 +01:00
julienfastre 3a9fac08c3 Merge remote-tracking branch 'origin/master' into issue332_location_activity 2021-12-14 19:55:16 +01:00
julienfastre f4fe297765 Merge branch 'issue336_internal_create_action_fixes' into 'master'
Issue336 internal create action fixes

See merge request Chill-Projet/chill-bundles!268
2021-12-14 18:48:31 +00:00
LenaertsJ 264bd76461 Issue336 internal create action fixes 2021-12-14 18:48:31 +00:00
Mathieu Jaumotte 45bcb27b79 Merge branch 'master' into fixes/thirdparty 2021-12-14 18:42:25 +01:00
Mathieu Jaumotte cf22a49487 Merge branch 'master' into 327_pinned_comment 2021-12-14 18:40:12 +01:00
Mathieu Jaumotte e71e369f15 temporary disable comment page in menu 2021-12-14 18:39:22 +01:00
Mathieu Jaumotte 1a604ecf65 Merge branch 'master' into divers 2021-12-14 18:32:12 +01:00
Mathieu Jaumotte da7bfa8a4e thirdparty: fix denormalization of thirdparty 2021-12-14 15:46:55 +01:00
Mathieu Jaumotte d3127bed6d thirdparty: add address on kind = contact 2021-12-14 14:57:11 +01:00
Mathieu Jaumotte 3c1c07dc64 comments: edit links with anchor and parameter 2021-12-14 10:54:44 +01:00
Mathieu Jaumotte 530267a9b0 commments: add basic form in template 2021-12-14 10:31:51 +01:00
julienfastre f9dd1c5231 fix cs 2021-12-13 22:57:50 +01:00
julienfastre f2fd30b690 add ordering to social issue and social action 2021-12-13 22:48:54 +01:00
julienfastre 3d3cc9aeb4 fix import 2021-12-13 22:19:05 +01:00
Mathieu Jaumotte 8b2a8544b8 form type and controller, wip 2021-12-13 21:58:56 +01:00
Mathieu Jaumotte be5f54c142 comments: build list 2021-12-13 21:49:03 +01:00
julienfastre 1fbe044729 update schema: an evaluation may be linked to multiple actions 2021-12-13 21:42:29 +01:00
julielenaerts 60032c96f7 update changelog and cs-fixer 2021-12-13 19:43:07 +01:00
julielenaerts 976f2fd41a fix thirdparty renderbox after merge 2021-12-13 19:37:19 +01:00
julielenaerts 19741530bf Corrections after merge (double declares) 2021-12-13 19:24:21 +01:00
julielenaerts 6e079fa771 Fix bug remove associated party in activity form 2021-12-13 19:24:03 +01:00
julielenaerts 8c14232a91 Conflict resolved after rebase 2021-12-13 19:16:53 +01:00
julielenaerts a983b34f0d styling adjusted 2021-12-13 19:06:27 +01:00
julielenaerts 4970cf000e behavior and style changed for adding motifs,obectifs, dispositifs 2021-12-13 19:06:27 +01:00
julielenaerts 1422ddeb2a restyling and deleting of console.logs 2021-12-13 19:06:27 +01:00
julielenaerts 9afc8c64ad stylefix 2021-12-13 19:06:27 +01:00
julielenaerts 200f1749f1 patchOnTheFly action added to store, bug in posting thirdparty though 2021-12-13 19:06:27 +01:00
julielenaerts 4645ede7d1 social issue added to title 2021-12-13 19:06:27 +01:00
julielenaerts 6016038813 add modal to confirm delete action + delete button changed 2021-12-13 19:06:06 +01:00
julielenaerts d40b0e88ed change of masquer message, removal double import 2021-12-13 19:06:06 +01:00
julielenaerts f26863487b fix badge mixin 2021-12-13 19:06:06 +01:00
julienfastre 5b531a0529 improve docgen wip 2021-12-13 19:04:37 +01:00
julienfastre a25123ee38 add docgen:normalization for relation 2021-12-13 19:03:42 +01:00
julienfastre 2524229941 docgen normalization for relation 2021-12-13 19:03:22 +01:00
julielenaerts 119a9981af Using thirdparty renderbox to display intervening thirdparties 2021-12-13 19:02:26 +01:00
julielenaerts decc18596b minor adjustment to allow for action title banner with correct colors 2021-12-13 19:01:36 +01:00
julielenaerts eea72c9bcd fix after rebase 2021-12-13 19:01:36 +01:00
julielenaerts 717b71ff54 first commit 2021-12-13 19:01:36 +01:00
julienfastre 64015479b1 improve docgen, trnslations, admin 2021-12-13 19:01:36 +01:00
julienfastre 18fa4eb586 fix tests (wip) 2021-12-13 19:00:13 +01:00
julienfastre 47574f82aa fix code style 2021-12-13 19:00:13 +01:00
julienfastre 12309ca1b5 fix tests (wip) 2021-12-13 18:59:43 +01:00
julielenaerts 20c95a179d first commit 2021-12-13 18:58:17 +01:00
Mathieu Jaumotte d5290e4bdd create comments page, with menu entry, route and template 2021-12-13 17:25:39 +01:00
Mathieu Jaumotte f4396459a0 comments: add isPinned() method 2021-12-13 16:42:41 +01:00
Mathieu Jaumotte f8071d32c0 batch replace/rename initialComment by pinnedComment 2021-12-13 16:31:16 +01:00
julienfastre 3973cdd3f6 update changelog [ci-skip] 2021-12-13 16:19:32 +01:00
julienfastre 4dc490beb7 change public function to protected function 2021-12-13 14:57:36 +00:00
Mathieu Jaumotte 52a137ee77 thirdparty: no need to burst the code: complete commit 1efdade38 2021-12-13 15:46:02 +01:00
Mathieu Jaumotte 985d8f0eae thirdparty form: clean builder, and test if this kind input address 2021-12-13 15:33:43 +01:00
nobohan f0a8aa6c90 upd CHANGELOG 2021-12-13 15:06:35 +01:00
julienfastre 13a1ab380e fix import social work metadata: use child social issue if any 2021-12-13 15:03:30 +01:00
julienfastre 041655d26e update changelog [ci-skip] 2021-12-13 15:03:30 +01:00
julienfastre 6e412117d3 Merge branch 'issue324_civility_order' into 'master'
main: add order field to civility

See merge request Chill-Projet/chill-bundles!265
2021-12-13 14:00:55 +00:00
nobohan bbebaa9fae household member editor: comment markNoAddress button 2021-12-13 14:58:01 +01:00
Mathieu Jaumotte 5526790d42 diaplay initialComment on course resume page 2021-12-13 14:49:16 +01:00
julienfastre cc849e279d fix column name 2021-12-13 14:38:33 +01:00
nobohan 159dba0dc3 household member editor: do not add in new members if the member is included in the members of household 2021-12-13 14:36:08 +01:00
julielenaerts 550b4775bf behavior and style changed for adding motifs,obectifs, dispositifs 2021-12-13 14:32:59 +01:00
nobohan f2c724726a household member editor: fix show other household warning + wording 2021-12-13 14:16:01 +01:00
julienfastre de262bbc28 civility::order: replace int by a float 2021-12-13 14:12:48 +01:00
Mathieu Jaumotte 133e4858dc household_member_editor: fix translation for onthefly and address modal, fix button appearance 2021-12-13 13:54:29 +01:00
julienfastre 2bafdd9e62 Merge branch 'fix/236-update-social-work-metadata-importer' into 'master'
Update Social Work Metadata importer

Closes champs-libres/departement-de-la-vendee/chill#236

See merge request Chill-Projet/chill-bundles!190
2021-12-13 12:49:03 +00:00
julienfastre d01eaa8065 various fixes 2021-12-13 13:48:20 +01:00
Mathieu Jaumotte b3ee745479 fix vue translation 2021-12-13 12:44:47 +01:00
nobohan 4a465b8f78 upd CHANGELOG 2021-12-13 12:39:09 +01:00
nobohan eaf7ae6f2f php cs fixer 2021-12-13 12:38:18 +01:00
nobohan b5178c3be3 main: add order field to civility 2021-12-13 12:35:17 +01:00
nobohan 13faf6fe5a household member editor: display when a concerned person already belongs to a household 2021-12-13 12:19:23 +01:00
nobohan da12aedb53 household: redirect to the household page when a household is created from a person 2021-12-13 11:19:29 +01:00
nobohan af87b3f6da household: add onthefly translations 2021-12-13 11:19:29 +01:00
nobohan 872090e02a household: change translations + add address i18n in household component 2021-12-13 11:19:29 +01:00
nobohan 4b432c64b0 php cs fixer 2021-12-13 11:07:30 +01:00
nobohan 8493a64794 upd CHANGELOG 2021-12-13 11:05:46 +01:00
nobohan 82c027fe2a add the current location of the user as API point + add it in the activity location list 2021-12-13 11:04:10 +01:00
julienfastre fdae6c106a Merge remote-tracking branch 'origin/master' into fix/236-update-social-work-metadata-importer 2021-12-13 11:01:19 +01:00
julielenaerts 1fff9ef535 stylefix 2021-12-13 10:10:05 +01:00
julielenaerts 20c4d07668 fix of aside activity category creation 2021-12-13 10:05:51 +01:00
Mathieu Jaumotte 7f2e3ee8e2 fix filiation error with gender undefined (#331) 2021-12-13 09:45:46 +01:00
Mathieu Jaumotte 7129b3149b undo partial wip resolution 2021-12-13 09:45:05 +01:00
nobohan 1e99ca2ca5 fix: add availableForUsers condition from locationType in the location API endpoint 2021-12-13 09:41:27 +01:00
Mathieu Jaumotte cc42a4ae51 Merge branch 'divers' of gitlab.com:Chill-Projet/chill-bundles into divers 2021-12-13 09:33:37 +01:00
Mathieu Jaumotte 6c28ff00ab onthefly create thirdparty: use badge-entity for radio buttons label 2021-12-13 09:30:34 +01:00
Mathieu Jaumotte d7db8400d2 accompanyingCourse list: display badges as clickable onthefly modal 2021-12-13 09:30:34 +01:00
Mathieu Jaumotte 16b3be322a actions list: display badges as clickable onthefly modal 2021-12-13 09:30:34 +01:00
Mathieu Jaumotte 6e1340be27 Merge branch 'master' into 292_activity_acl 2021-12-13 09:21:32 +01:00
Mathieu Jaumotte 118b208f68 Merge branch 'master' into 292_activity_acl 2021-12-13 09:13:43 +01:00
julienfastre e21f12d96c Merge remote-tracking branch 'origin/master' 2021-12-12 21:05:35 +01:00
julienfastre 4b213dc290 remove dump [ci-skip] 2021-12-12 21:05:12 +01:00
julienfastre 55991a6082 Merge branch 'issue309_format_address' into 'master'
main: change address format for France, in Address render box and normalizer

See merge request Chill-Projet/chill-bundles!259
2021-12-12 15:05:54 +00:00
juminet 898f25c0e4 main: change address format for France, in Address render box and normalizer 2021-12-12 15:05:54 +00:00
julienfastre b3929321b6 Merge branch 'badge_by_entity_type' into 'master'
Badge-thirdparty

See merge request Chill-Projet/chill-bundles!258
2021-12-12 14:51:43 +00:00
Mathieu Jaumotte c049a0b78b Badge-thirdparty 2021-12-12 14:51:42 +00:00
julienfastre 10aa897899 Merge branch 'docgen/improve-normalizer' into 'master'
Docgen/improve normalizer

See merge request Chill-Projet/chill-bundles!257
2021-12-12 14:43:05 +00:00
julienfastre 31f5d97912 Docgen/improve normalizer 2021-12-12 14:43:05 +00:00
julienfastre c6cda437c4 Merge branch 'issue324_person' into 'master'
fix some person issues

See merge request Chill-Projet/chill-bundles!254
2021-12-12 14:39:59 +00:00
juminet 7e045e964a fix some person issues 2021-12-12 14:39:59 +00:00
julienfastre 133ac67794 Merge branch 'issue320_bug_redirect_createPeriod' into 'master'
Issue320 bug redirect create period

See merge request Chill-Projet/chill-bundles!249
2021-12-12 14:12:44 +00:00
LenaertsJ 8fb4efc16e Issue320 bug redirect create period 2021-12-12 14:12:44 +00:00
julienfastre 1823a1b031 Merge branch 'issue318_internal_addIssue_fromAction' into 'master'
Adding an unrelated to issue to an accompanyingCourseWork

See merge request Chill-Projet/chill-bundles!246
2021-12-12 13:55:23 +00:00
LenaertsJ 683d055088 Adding an unrelated to issue to an accompanyingCourseWork 2021-12-12 13:55:22 +00:00
julienfastre 839fb4a211 Squashed commit of the following:
commit 977863c2dd56d5c835f2a710cad7f7d3ba42da68
Merge: 5c37b419d 3eb7ffed1
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Dec 12 14:45:21 2021 +0100

    Merge remote-tracking branch 'origin/master' into docgen/improve-normalizer

commit 5c37b419ddf0b32b9950c33042396bba1860da84
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Dec 12 14:37:05 2021 +0100

    fix normalization for user and type in null value

commit 4469d46cdb19051fedec86bbb84e2351e6fcb72e
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Dec 12 13:24:23 2021 +0100

    add civility to person

commit 6cf92fbbde8f4d9f2f4763ec4ee88216257040f7
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Dec 12 13:19:36 2021 +0100

    fix person normalization: add a isNull on not null person

commit ed6087ff8fd47b80ea5e9526756fe5d032d478e3
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Dec 12 13:08:46 2021 +0100

    fix stan and cs issues

commit 8429c334c33b3545835cbde034fccaa529c134a7
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Dec 12 13:08:36 2021 +0100

    fix id type

commit 39ae00d172a9f29320a97abb8518b2ea48d89d9b
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sun Dec 12 12:52:41 2021 +0100

    fix test and fix null or not-null value have same keys

commit 312fcc44c07affa7aa60f6c5fce58f9d1c564cc3
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sat Dec 11 03:27:30 2021 +0100

    improve normalization wip

commit f91a29635827005fc58617dc1c9d210091372be5
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sat Dec 11 01:15:32 2021 +0100

    improve normalization

commit 56060e5e6a2191ef441039fdc91a01fb4653a553
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Sat Dec 11 00:41:09 2021 +0100

    handle changelog with translatable string

commit 9004686a13
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Fri Dec 10 01:10:55 2021 +0100

    improve docgen wip

commit e266fa0e5d
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Thu Dec 9 21:50:56 2021 +0100

    show errors from relatorio driver

commit 75ba56fa09
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Thu Dec 9 21:14:12 2021 +0100

    add verification tool for admin

commit 12d6829b98
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Thu Dec 9 14:17:42 2021 +0100

    fix type with phonenumber helper

commit 7b5e96771f
Merge: 8a9024de1 8a4748dc2
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Thu Dec 9 14:11:14 2021 +0100

    Merge remote-tracking branch 'origin/master' into docgen/improve-normalizer

commit 8a9024de13
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Thu Dec 9 13:51:36 2021 +0100

    add docgen:normalization for relation

commit 24a404964b
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Thu Dec 9 12:44:41 2021 +0100

    docgen normalization for relation

commit 5d24bd4d11
Merge: 70ab23214 455b225f4
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 21:08:30 2021 +0100

    Merge branch 'master' into docgen/improve-normalizer

commit 70ab232149
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 13:58:49 2021 +0100

    improve docgen, trnslations, admin

commit 027c01fc58
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 12:23:24 2021 +0100

    fix css block

commit fdc5127c74
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 11:57:16 2021 +0100

    fix some error in test (wip)

commit b8d48f04ae
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 11:47:50 2021 +0100

    fix tests (wip)

commit f1b1771d6b
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 11:35:00 2021 +0100

    fix tests (wip)

commit 62dabbe1e7
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 11:14:46 2021 +0100

    fix code style

commit 4101392190
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 11:13:49 2021 +0100

    fix tests and type hinting

commit 3f1bed0b1c
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 11:05:41 2021 +0100

    fix tests (wip)

commit 79fbdcdee4
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 11:05:29 2021 +0100

    type hint User class

commit 3d8d79323e
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 10:56:30 2021 +0100

    remove error messages

commit 32178e22fe
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 10:51:30 2021 +0100

    fix tests (wip)

commit 60a8c20896
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 10:29:54 2021 +0100

    update app

commit 9d8011da61
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 10:06:35 2021 +0100

    fix loading origin

commit 789eeadb40
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 09:52:51 2021 +0100

    fix loading fixtures for doc generator template

commit f206fdb08c
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 09:52:35 2021 +0100

    fix code style

commit 9d5409d8d9
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 09:52:06 2021 +0100

    fix casting

commit e297d82533
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Dec 8 09:26:13 2021 +0100

    fixes on tests [WIP]
2021-12-12 14:46:37 +01:00
julielenaerts 329026e36c restyling and deleting of console.logs 2021-12-10 17:47:16 +01:00
julielenaerts 19a53ada88 stylefix 2021-12-10 17:24:38 +01:00
julielenaerts 4c31100dc7 patchOnTheFly action added to store, bug in posting thirdparty though 2021-12-10 17:14:18 +01:00
julielenaerts 536a1a46da social issue added to title 2021-12-10 17:01:06 +01:00
julielenaerts 5ed7572f95 bugfix 2021-12-10 17:00:19 +01:00
julielenaerts f1067661d4 add modal to confirm delete action + delete button changed 2021-12-10 17:00:04 +01:00
Mathieu Jaumotte 3592434623 onthefly create thirdparty: use badge-entity for radio buttons label 2021-12-10 15:37:12 +01:00
Mathieu Jaumotte 94ec165c4c accompanyingCourse list: display badges as clickable onthefly modal 2021-12-10 14:30:16 +01:00
Mathieu Jaumotte 1c3c2be176 actions list: display badges as clickable onthefly modal 2021-12-10 14:10:23 +01:00
nobohan 3eb7ffed1a quick fix: use role as string in 2 functions arguments 2021-12-10 14:04:41 +01:00
Mathieu Jaumotte d0c5d0423f update changelog 2021-12-10 12:58:07 +01:00
Mathieu Jaumotte f2117ea1cd improve activity new/edit twig template 2021-12-10 12:51:18 +01:00
Mathieu Jaumotte c7ee2cc600 add entity 'user' to pills badge-entity 2021-12-10 12:38:19 +01:00
Mathieu Jaumotte 57c4f2ee61 improve activity show twig template 2021-12-10 12:12:17 +01:00
Mathieu Jaumotte 95caa998e3 concernedGroups display badges as clickable onthefly modal 2021-12-10 12:09:50 +01:00
julielenaerts edaad844aa Merge branch 'docgen/improve-normalizer' into issue321_layout_improvements_actionForm 2021-12-10 11:47:30 +01:00
julielenaerts 2edf36b6c5 change of masquer message, removal double import 2021-12-10 11:47:01 +01:00
julielenaerts 95e45a8ad2 fix badge mixin 2021-12-10 10:46:47 +01:00
Mathieu Jaumotte 97165c8389 activity: set ACL (issue 292)
https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/292
2021-12-10 10:35:37 +01:00
Mathieu Jaumotte 1efdade382 thirdparty: no need to burst the code 2021-12-10 10:35:37 +01:00
Mathieu Jaumotte cf219198ca update changelog 2021-12-10 10:32:50 +01:00
julienfastre 9004686a13 improve docgen wip 2021-12-10 01:10:55 +01:00
julienfastre e266fa0e5d show errors from relatorio driver 2021-12-09 21:50:56 +01:00
julienfastre 75ba56fa09 add verification tool for admin 2021-12-09 21:14:12 +01:00
Mathieu Jaumotte 5a2e6c0969 AddPerson suggestions: all line make checkbox clickable 2021-12-09 17:18:06 +01:00
Mathieu Jaumotte 84f772b42b hop 2021-12-09 16:50:07 +01:00
Mathieu Jaumotte 62b8b3e6b7 add thirdparty comment in acccourse resources 2021-12-09 16:25:45 +01:00
Mathieu Jaumotte 5fdbba9ef5 thirdparty: improve render for children/parent dependencies in renderbox vue/twig 2021-12-09 16:17:04 +01:00
Mathieu Jaumotte 5b321dfb81 list-suggest: add classes to change list disposition 2021-12-09 14:34:34 +01:00
julienfastre 12d6829b98 fix type with phonenumber helper 2021-12-09 14:17:42 +01:00
julienfastre 7b5e96771f Merge remote-tracking branch 'origin/master' into docgen/improve-normalizer 2021-12-09 14:11:14 +01:00
julienfastre 8a9024de13 add docgen:normalization for relation 2021-12-09 13:51:36 +01:00
julielenaerts 9387d37746 Resolve merge conflict 2021-12-09 13:49:22 +01:00
julienfastre 24a404964b docgen normalization for relation 2021-12-09 12:44:41 +01:00
julielenaerts 534a8bb3af Using thirdparty renderbox to display intervening thirdparties 2021-12-09 12:35:52 +01:00
julielenaerts 21e3da0266 minor adjustment to allow for action title banner with correct colors 2021-12-09 12:34:44 +01:00
julielenaerts 85a1fcca18 fix after rebase 2021-12-09 11:49:37 +01:00
julielenaerts 793f5116ab first commit 2021-12-09 11:39:15 +01:00
Mathieu Jaumotte 10f276e48c list-suggest add-items hover effect 2021-12-09 11:18:14 +01:00
julielenaerts 8a4748dc2d position of toast changed to bottom-right 2021-12-09 10:38:04 +01:00
Mathieu Jaumotte f5ae5443ab badge-entity: mask 'tiers' when displayLong (??) 2021-12-09 09:40:52 +01:00
julienfastre 5d24bd4d11 Merge branch 'master' into docgen/improve-normalizer 2021-12-08 21:08:30 +01:00
Mathieu Jaumotte 9272687ec4 adapt in twig thirdparty renderbox 2021-12-08 17:45:07 +01:00
Mathieu Jaumotte 6100176c9f try badgeEntity with displayLong option 2021-12-08 17:29:31 +01:00
Mathieu Jaumotte 56ab304af1 try badge with hover 2021-12-08 16:12:47 +01:00
julienfastre 70ab232149 improve docgen, trnslations, admin 2021-12-08 13:58:49 +01:00
julienfastre 027c01fc58 fix css block 2021-12-08 12:23:24 +01:00
Mathieu Jaumotte b888211ef9 proposition for person/thirparty rounded-pill badge appearance 2021-12-08 12:19:03 +01:00
Mathieu Jaumotte 0617014e91 some small style improvements in thirdparty section 2021-12-08 12:19:03 +01:00
Mathieu Jaumotte ce171ec747 household-members-editor: lightly improve ux (TO CHECK) 2021-12-08 12:19:02 +01:00
julienfastre fdc5127c74 fix some error in test (wip) 2021-12-08 11:57:16 +01:00
julienfastre 455b225f49 Merge branch 'tests/fixes-2021-12-07' into 'master'
fixes on tests

See merge request Chill-Projet/chill-bundles!256
2021-12-08 10:56:39 +00:00
julienfastre fa5001265f fixes on tests 2021-12-08 10:56:39 +00:00
julienfastre b8d48f04ae fix tests (wip) 2021-12-08 11:47:50 +01:00
julienfastre f1b1771d6b fix tests (wip) 2021-12-08 11:35:00 +01:00
julienfastre 62dabbe1e7 fix code style 2021-12-08 11:14:46 +01:00
julienfastre 4101392190 fix tests and type hinting 2021-12-08 11:13:49 +01:00
julienfastre 3f1bed0b1c fix tests (wip) 2021-12-08 11:05:41 +01:00
julienfastre 79fbdcdee4 type hint User class 2021-12-08 11:05:29 +01:00
julienfastre 3d8d79323e remove error messages 2021-12-08 10:56:30 +01:00
julienfastre 32178e22fe fix tests (wip) 2021-12-08 10:51:30 +01:00
julienfastre 60a8c20896 update app 2021-12-08 10:29:54 +01:00
julienfastre 9d8011da61 fix loading origin 2021-12-08 10:06:35 +01:00
julienfastre 789eeadb40 fix loading fixtures for doc generator template 2021-12-08 09:52:51 +01:00
julienfastre f206fdb08c fix code style 2021-12-08 09:52:35 +01:00
julienfastre 9d5409d8d9 fix casting 2021-12-08 09:52:06 +01:00
julienfastre e297d82533 fixes on tests [WIP] 2021-12-08 09:26:13 +01:00
julienfastre 56dd825f39 Merge remote-tracking branch 'origin/master' 2021-12-07 18:23:13 +01:00
julienfastre 4e4add3cc1 check for ancestors when validating the presence of accompanying
period's social issues
2021-12-07 18:17:22 +01:00
julienfastre b684bdfa3b Merge branch 'issue279_accompanying_period_validation' into 'master'
accompanying period validation - on social issues suppression

See merge request Chill-Projet/chill-bundles!250
2021-12-07 17:16:14 +00:00
juminet b683630136 accompanying period validation - on social issues suppression 2021-12-07 17:16:13 +00:00
julienfastre e6c60e66fc fix validator for taking ancestors into account 2021-12-07 18:05:05 +01:00
julienfastre b1b9acc686 Merge branch 'bugfix/activity-fix-location-visibility' into issue279_accompanying_period_validation 2021-12-07 17:57:02 +01:00
julienfastre f6408af543 Merge branch 'master' into issue279_accompanying_period_validation 2021-12-07 17:55:00 +01:00
julienfastre 5b4388eae6 update changelog [ci-skip] 2021-12-07 16:42:34 +01:00
julienfastre 41ecb2351e Merge branch 'master' into bugfix/activity-fix-location-visibility 2021-12-07 16:41:59 +01:00
julienfastre 6cc0f1f98b update changelog [ci-skip] 2021-12-07 16:41:35 +01:00
julienfastre aa68ae0b25 [ActivityType] remove placeLabel/visible, replace by
locationLabel/visible
2021-12-07 16:38:43 +01:00
julienfastre ebd817f61e fix cs 2021-12-06 17:27:57 +01:00
julienfastre 25147704ad fix uppercase in person form with strict types 2021-12-06 17:24:58 +01:00
julienfastre 2788149db4 fix error when using twilio format 2021-12-06 17:24:35 +01:00
julienfastre fabe32371f fix menu doc generator 2021-12-06 17:19:22 +01:00
julienfastre b120e47786 add translations 2021-12-06 16:17:30 +01:00
julienfastre 5a61f05faa Merge remote-tracking branch 'origin/master' into features/docgen-widget-generate-template 2021-12-06 15:46:19 +01:00
julienfastre 7c2a283437 Merge branch 'page_accourse_lists' into 'master'
Cohérence graphique des listes d'activités et d'actions dans le contexte d'un parcours

See merge request Chill-Projet/chill-bundles!251
2021-12-06 14:45:44 +00:00
Mathieu Jaumotte 2d1e8b2acd Cohérence graphique des listes d'activités et d'actions dans le contexte d'un parcours 2021-12-06 14:45:44 +00:00
julienfastre afb7d4a160 try to fix [wip] 2021-12-06 15:37:20 +01:00
julienfastre 96e5e4a7b2 Merge remote-tracking branch 'origin/master' into issue279_accompanying_period_validation 2021-12-06 15:08:56 +01:00
julienfastre 8e6e92ae89 Merge branch 'issue128_remove_titulaire_field' into 'master'
titulaire field removed from household edit form

See merge request Chill-Projet/chill-bundles!248
2021-12-06 14:07:21 +00:00
LenaertsJ 07f53e6758 titulaire field removed from household edit form 2021-12-06 14:07:21 +00:00
julienfastre d2c61a26ea Merge branch '306_visgraph_corrections' into 'master'
306 fix visgraph issues

See merge request Chill-Projet/chill-bundles!245
2021-12-06 14:01:51 +00:00
Mathieu Jaumotte bbc5e94033 306 fix visgraph issues 2021-12-06 14:01:50 +00:00
julienfastre 8e8a8c1e70 Merge branch 'issue280_actionToCourse' into 'master'
Eventlistener to create accompanyingPeriodWork

See merge request Chill-Projet/chill-bundles!244
2021-12-06 13:57:10 +00:00
LenaertsJ f10d762e59 Eventlistener to create accompanyingPeriodWork 2021-12-06 13:57:10 +00:00
julienfastre 9924c3a3b7 Merge branch 'issue305_internal_fixbug_posting_dates' into 'master'
Fix bug posting birth- and deathdate

See merge request Chill-Projet/chill-bundles!243
2021-12-06 13:04:19 +00:00
LenaertsJ cea7160d5a Fix bug posting birth- and deathdate 2021-12-06 13:04:19 +00:00
julienfastre 5669f62fdc Merge branch 'issue316-addresses-search-by-postal-code' into 'master'
Issue316 addresses search by postal code

See merge request Chill-Projet/chill-bundles!239
2021-12-06 12:56:57 +00:00
julienfastre 938720be52 Issue316 addresses search by postal code 2021-12-06 12:56:57 +00:00
julienfastre c4998f4ac1 normalization for docgen:read: add groups and so on (wip) 2021-12-06 13:18:59 +01:00
nobohan 15c7c6ccde fix code syntax using php stan 2021-12-06 10:06:55 +01:00
nobohan 3c3d63e286 upd CHANGELOG 2021-12-06 10:04:25 +01:00
nobohan 74682549c8 person: fix accompanying period validation 2021-12-06 10:00:40 +01:00
julienfastre 51fd81c661 code style 2021-12-04 01:14:37 +01:00
julienfastre 063ceb2c53 various improvements 2021-12-04 01:13:55 +01:00
julienfastre 6c1a946608 generate context for evaluations 2021-12-03 23:31:19 +01:00
julienfastre 29134f0f11 continue context for evaluations 2021-12-03 20:24:31 +01:00
julienfastre 2d319fcc42 adapting vuejs form for accompanyingPeriodWork: include template for
specific evaluation
2021-12-03 20:09:31 +01:00
julielenaerts 32a7734d30 first commit 2021-12-03 18:58:57 +01:00
nobohan 2e4356c3c9 person: add custom class validator for accompanying period 2021-12-03 18:10:52 +01:00
julienfastre 51bbcab878 Merge branch 'cherry-pick-a86ba6fa' into 'master'
fix code style

See merge request Chill-Projet/chill-bundles!253
2021-12-03 15:57:57 +00:00
julienfastre 5645cb0cdd Merge branch 'cherry-pick-43702ded' into 'master'
fix pagination problems

See merge request Chill-Projet/chill-bundles!252
2021-12-03 15:57:36 +00:00
julienfastre 02c93389d8 fix code style
(cherry picked from commit a86ba6faf5)
2021-12-03 14:20:01 +00:00
julienfastre a86ba6faf5 fix code style 2021-12-03 15:18:45 +01:00
julienfastre e1d4868f51 Merge remote-tracking branch 'origin/master' into features/docgen-widget-generate-template 2021-12-03 15:17:50 +01:00
julienfastre 9244bb2f8d fix pagination problems
(cherry picked from commit 43702ded77)
2021-12-03 14:10:07 +00:00
julienfastre 43702ded77 fix pagination problems 2021-12-03 15:06:06 +01:00
nobohan 611f0a9ca6 activity: fix type hinting in activity form - fix 2021-12-03 14:38:55 +01:00
nobohan d2704ad7e6 activity: fix type hinting in activity form 2021-12-03 14:34:21 +01:00
julienfastre ff751b7f30 remove validation about UserCircleConsistency 2021-12-03 13:25:39 +00:00
julienfastre 23eff9f6d4 add basic context for AccompanyingPeriodWorkEvalution WIP 2021-12-03 13:50:35 +01:00
julienfastre e053529afb add docgen context for AccompanyingPeriodWork 2021-12-03 12:21:36 +01:00
nobohan 8affeb08d9 person: add altnames in the onthefly component 2021-12-03 12:10:02 +01:00
nobohan 047083812e person: add altNames in person form: v-model option but not working 2021-12-03 11:27:18 +01:00
julienfastre be626079d0 move logic of context to different interfaces 2021-12-02 18:18:11 +01:00
julienfastre af6efdd0ba generate document with relatorio: config and driver 2021-12-02 18:02:19 +01:00
julienfastre 2245f83631 generate document with relatorio: config and driver 2021-12-02 17:00:09 +01:00
julielenaerts 75eb6414ce test set back to what it was otherwise error 2021-12-02 15:38:27 +01:00
julielenaerts 5e7445a4fe stylefix 2021-12-02 15:31:38 +01:00
julielenaerts c527b1b3cf validation attempt with assert\callback: still doesn't work 2021-12-02 15:31:08 +01:00
julielenaerts acacef936c changelog updated and stylefix 2021-12-02 12:49:33 +01:00
julielenaerts f971dc05eb test written, but the validation expression is not yet correct 2021-12-02 12:33:10 +01:00
nobohan 49da5fe060 person: fix altname denormalisation 2021-12-02 12:00:57 +01:00
nobohan bcdddcde9b person: new person modal: add email field + re-order fields 2021-12-02 10:59:59 +01:00
nobohan 64d3edfc42 person: [technical debt]: hardcode altname array 2021-12-02 10:59:59 +01:00
nobohan 912f9bacdb person: document altname api endpoint in swagger 2021-12-02 10:59:59 +01:00
nobohan 55e94fbe2a person: retrieve altname config with ConfigPersonAltNamesHelper 2021-12-02 10:59:59 +01:00
nobohan c5acfc9bbc person: deserialise altnames (WIP) 2021-12-02 10:59:59 +01:00
nobohan 780b7db8cb person: add altnames in the person creation modal 2021-12-02 10:59:59 +01:00
nobohan d71d1beb42 person: remove api endpoint (was a mistake) 2021-12-02 10:59:59 +01:00
nobohan 3d3ce7814b person: add api endpoint for altname + implement getValidationGroups 2021-12-02 10:59:59 +01:00
nobohan 438cb7317a person: add api point for altname config 2021-12-02 10:59:59 +01:00
julienfastre 475b40e896 add form to doc generation and custom form to admin template configuration 2021-12-01 23:00:02 +01:00
julienfastre 7719d2b073 full generation for accompanying period 2021-12-01 15:43:34 +01:00
julienfastre 9d0e1a82e7 add deps to base64 2021-12-01 15:41:59 +01:00
julienfastre 9f43c99acc handle finding returnType on property type on parent classes 2021-12-01 15:39:44 +01:00
julienfastre de4e83b3fb Generate a context for docgen, on accompanying period 2021-11-30 23:23:02 +01:00
julienfastre 3404d3669c create contextmanager and refactor docgeneratorTemplateType 2021-11-30 18:35:05 +01:00
julienfastre 0710d6572b Merge remote-tracking branch 'origin/docgenerator_oct_nov_21' into features/docgen-widget-generate-template 2021-11-30 18:31:33 +01:00
julienfastre cf442461d6 Merge remote-tracking branch 'origin/master' into features/docgen-widget-generate-template 2021-11-30 16:38:36 +01:00
Pol Dellaiera 6e521642a4 fix: Typed property RedisConnectionFactory::$redis must not be accessed before initialization. 2021-11-30 15:22:32 +01:00
marcu 0e88d7c549 Using HttpClientInterface instead of file_get_contents 2021-11-30 14:53:50 +01:00
marcu 2993dab3f7 Debug using KernelInterface instead HttpKernelInterface 2021-11-30 14:53:50 +01:00
marcu d026be3041 Create new layer + convert in good crs 2021-11-30 14:53:50 +01:00
marcu 59a0b692ac Fix load fixtures (LoadDocGeneratorTemplates) 2021-11-30 14:53:50 +01:00
marcu 9fa2e80d81 Debug : redeclaration of a varaible 2021-11-30 14:53:50 +01:00
Marc Ducobu 4e56075fdc Removing unused deps 2021-11-30 14:53:48 +01:00
Marc Ducobu 2b01179967 DocGeneratorTemplate use StoredObject for storign the template 2021-11-30 14:53:05 +01:00
Marc Ducobu 847e610362 Good values to point to a doc file 2021-11-30 14:53:05 +01:00
Marc Ducobu a7af7e7874 php-decrypt data crypted using js 2021-11-30 14:53:01 +01:00
Marc Ducobu 1bf595334e Adding AccompanyingPeriodWorkEvaluation in the choices of DocGenerator config form (admin) 2021-11-30 14:51:43 +01:00
Marc Ducobu a3333c3302 Fix LoadDocGeneratorTemplate (using docstore obj) 2021-11-30 14:51:43 +01:00
Marc Ducobu 7fe2172f05 DocGeneratorTemplate use StoredObject for storign the template 2021-11-30 14:51:43 +01:00
julielenaerts e76e5dd02d fix argument type 2021-11-30 14:50:26 +01:00
Pol Dellaiera a3da9c538c tests: Fix argument type. 2021-11-30 14:22:15 +01:00
Pol Dellaiera 5a2d297c2e tests: Fix argument type. 2021-11-30 14:10:38 +01:00
Pol Dellaiera 56037f796b fix: Import missing annotation. 2021-11-30 14:02:20 +01:00
Pol Dellaiera 1041627f87 sa: Remove now obsolete reported PHPStan issues. 2021-11-30 13:55:46 +01:00
Pol Dellaiera cd3be25c22 cs: Remove duplicated headers. 2021-11-30 13:54:58 +01:00
Pol Dellaiera 47c5855a21 cs: Switch to a stricter way of coding - this might break in a lot of places. 2021-11-30 13:33:18 +01:00
Pol Dellaiera 28d2c42454 cs: Enable more risky rules. 2021-11-30 12:27:49 +01:00
Pol Dellaiera 733bee06a8 cs: Enable more risky rules. 2021-11-30 12:19:29 +01:00
Pol Dellaiera 579c349e28 cs: Enable more risky rules. 2021-11-30 12:09:24 +01:00
Pol Dellaiera 6ce511889f cs: Enable more risky rules. 2021-11-30 12:03:02 +01:00
Pol Dellaiera a43784c3a1 cs: Enable risky rule random_api_migration. 2021-11-30 11:55:02 +01:00
Pol Dellaiera 91d12c4a96 cs: Enable risky rule static_lambda. 2021-11-30 11:43:34 +01:00
Pol Dellaiera a9188355c5 cs: Enable more risky rules. 2021-11-30 11:37:57 +01:00
Pol Dellaiera c8195e6df5 cs: Enable more risky rules. 2021-11-30 11:28:52 +01:00
Pol Dellaiera 3631fd99fd cs: Enable risky rule is_null. 2021-11-30 10:22:38 +01:00
Pol Dellaiera e11c249131 Fix constant name. 2021-11-30 10:09:17 +01:00
Pol Dellaiera 6e9827806f Remove obsolete PHPStan issues. 2021-11-30 10:08:12 +01:00
Pol Dellaiera f531cdc0ec cs: Enable a couple of risky rules. 2021-11-30 09:39:45 +01:00
julienfastre acc4647346 [person search] increase pertinence when person's lastname starts with
search pattern
2021-11-29 23:24:34 +01:00
julienfastre 54a4b48174 [person search] fix bug when using birhtdateafter and birthdate before on advanced search 2021-11-29 23:11:13 +01:00
julienfastre e99b14b870 [activity] fix loading of social action in edit mode 2021-11-29 23:01:17 +01:00
julienfastre 7b0c7988df [activity] handle case when there is no action associated to selected
issues
2021-11-29 22:43:14 +01:00
julienfastre 55b9242690 [bugfix][activity form] check the presence of location / social issues /
persons fields
2021-11-29 21:57:29 +01:00
julienfastre 4854f40648 [bugfix] fix template "new" for activity 2021-11-29 21:27:17 +01:00
julienfastre 217b74b9e2 [Household] when two adresses on same date, close the existing one 2021-11-29 21:27:17 +01:00
julienfastre 18cfe17878 changelog: new release today 2021-11-29 21:27:17 +01:00
Mathieu Jaumotte aca1d1f9e9 Merge branch 'master' into 295_resume_retouches 2021-11-29 15:43:16 +01:00
julienfastre 2102e65729 Merge branch 'issue180_activity_coherence' into 'master'
activity: edit an activity: choose the context based on the activity, not the url parameters

See merge request Chill-Projet/chill-bundles!226
2021-11-29 13:56:12 +00:00
juminet 975fbfbdee activity: edit an activity: choose the context based on the activity, not the url parameters 2021-11-29 13:56:12 +00:00
julienfastre 3b725a8a12 Merge branch '295_resume_retouches' into 'master'
295 resume retouches

See merge request Chill-Projet/chill-bundles!238
2021-11-29 13:48:18 +00:00
Mathieu Jaumotte 5d9ceb5757 295 resume retouches 2021-11-29 13:48:18 +00:00
julienfastre 3c70cec396 merge origin/master 2021-11-29 14:33:29 +01:00
julienfastre 16b130b9a5 Merge remote-tracking branch 'origin/master' into issue314_suggest_persons 2021-11-29 14:28:39 +01:00
julienfastre eee9bff711 remove entities which are present twice 2021-11-29 14:28:24 +01:00
julielenaerts 9aba4ea8f6 first commit 2021-11-29 14:06:22 +01:00
Mathieu Jaumotte 4acedc84b0 vue_accourse: fix list-suggest asset for items suggestions 2021-11-29 13:55:38 +01:00
julienfastre c64ab86f8e Merge remote-tracking branch 'origin/master' into issue314_suggest_persons 2021-11-29 13:45:37 +01:00
julienfastre bd98e9cc9b Merge branch 'add_toasters' into 'master'
Display of toasts for accompanying course + general makeFetch

See merge request Chill-Projet/chill-bundles!221
2021-11-29 12:39:11 +00:00
LenaertsJ d5a269356b Display of toasts for accompanying course + general makeFetch 2021-11-29 12:39:11 +00:00
julienfastre 02a8c1ae10 Merge branch 'issue313_activity' into 'master'
activity: avoid existing entities being added in Users, ThirdParties, Persons

See merge request Chill-Projet/chill-bundles!237
2021-11-29 12:27:55 +00:00
juminet b300858bdd activity: avoid existing entities being added in Users, ThirdParties, Persons 2021-11-29 12:27:54 +00:00
Mathieu Jaumotte f58df2a25a update changelog 2021-11-29 12:35:05 +01:00
Mathieu Jaumotte ed38322218 Merge branch '_concernedgroups_twig_' into 295_resume_retouches 2021-11-29 12:29:57 +01:00
Mathieu Jaumotte be71decee5 concernedGroups.html.twig check if block isVisible, count block and adjust width 2021-11-29 12:29:15 +01:00
julienfastre 58119b3de0 Merge branch 'issue297_confidential_toggle' into 'master'
confidential toggle rights

See merge request Chill-Projet/chill-bundles!227
2021-11-29 11:01:51 +00:00
LenaertsJ e4e1edff68 confidential toggle rights 2021-11-29 11:01:51 +00:00
julienfastre 6d6f930afa Merge branch 'issue307_location' into 'master'
improve location encoding

See merge request Chill-Projet/chill-bundles!230
2021-11-29 10:40:10 +00:00
Mathieu Jaumotte ccff346dbb resume page: change order for masonry blocks, don't render empty blocks 2021-11-29 10:51:26 +01:00
julienfastre bbf6b1412f repair admin docgen WIP 2021-11-29 10:42:43 +01:00
nobohan cb89fc5ef5 person: style list-suggest 2021-11-29 10:16:23 +01:00
Mathieu Jaumotte 6ee01621c8 update changelog 2021-11-29 09:46:27 +01:00
nobohan efaaa72a7e upd CHANGELOG 2021-11-29 09:34:46 +01:00
nobohan 037532d13c person: entities suggestion in parcours: style list 2021-11-29 09:31:33 +01:00
nobohan 60422f5eee person: suggest entities for resources 2021-11-28 22:53:36 +01:00
nobohan 4abb1a7a57 person: suggest entities for requestor 2021-11-28 22:32:19 +01:00
nobohan 0ad7ca6235 person: init suggested entities in accompanying course
(working)
2021-11-28 22:17:00 +01:00
julienfastre 9f868bff4f create module for generating document in twig pages 2021-11-28 21:24:18 +01:00
nobohan 5fab0ffe27 accompanying course: add resource 2021-11-28 21:16:48 +01:00
Mathieu Jaumotte 406ec14c3d add JS masonry placement on resume page 2021-11-27 16:34:55 +01:00
Mathieu Jaumotte aeb165d6cc update changelog 2021-11-27 12:27:57 +01:00
Mathieu Jaumotte d616c20534 accourse resume page: add all informations needed for activities 2021-11-27 12:24:54 +01:00
julienfastre 1c18ba20fc docgen: improve listing for templates 2021-11-27 01:23:34 +01:00
nobohan 44a09903a0 person: init suggested entities in accompanying course 2021-11-26 21:08:07 +01:00
Mathieu Jaumotte 34c525e378 accourse resume page: social-actions, list of evaluations with colored triangle bullet 2021-11-26 20:10:00 +01:00
Mathieu Jaumotte 16fcfda88f accourse resume page: social-actions, put some items in 2 columns 2021-11-26 19:57:06 +01:00
Mathieu Jaumotte 93dbc32009 accourse resume page: add all informations needed for social-actions
cfr. vendee PROPOSITION_INFO_AFFICHEES.xlsx (column F)
2021-11-26 18:56:56 +01:00
Mathieu Jaumotte 40ca1e276b styles sheets cleaning 2021-11-26 17:08:29 +01:00
Mathieu Jaumotte 74660448a1 accourse resume page: actions and activities are clickable links 2021-11-26 16:51:00 +01:00
Mathieu Jaumotte 10070d1581 update changelog 2021-11-25 19:13:17 +01:00
Mathieu Jaumotte 37cc540970 vue_accourseWorkEdit: improve show/hide button + list-suggest improve hyphens on badge too large 2021-11-25 19:04:13 +01:00
nobohan 5aa5cb3e08 location: use fetchResults for getLocations and getLocationTypes 2021-11-25 17:22:25 +01:00
Mathieu Jaumotte 8ac3dab0a2 update changelog 2021-11-25 16:54:49 +01:00
nobohan f002d48efd location: fix error when there is no defaultFor defined for locationType entities 2021-11-25 16:53:02 +01:00
Mathieu Jaumotte 666b4c9f5e Merge branch '_resume_test_persons' into 295_resume_retouches 2021-11-25 16:51:30 +01:00
Mathieu Jaumotte d274ba3823 #258 apply assets to lists of suggestion, adapt item-title case 2021-11-25 16:49:50 +01:00
nobohan aad4b6e5d0 location: allow null value for defaultFor 2021-11-25 16:18:45 +01:00
nobohan 36c57511e8 location: fix code style with phpstan 2021-11-25 16:10:08 +01:00
julienfastre 3f35f0e251 add unique constraint on property validFor for LocationType 2021-11-25 15:40:38 +01:00
nobohan 09a679ffb9 upd CHANGELOG 2021-11-25 15:40:38 +01:00
nobohan 3d5db29a4c location: filter location api point only by active and availableForUsers 2021-11-25 15:39:30 +01:00
nobohan e73179688a activity: format location label for parcours location 2021-11-25 15:39:30 +01:00
nobohan 2ee4a6b2ac calendar: dynamic way of creating location when creating a calendar 2021-11-25 15:39:30 +01:00
nobohan 220f297391 calendar: cast collection to array 2021-11-25 15:39:30 +01:00
nobohan d13d42b9bf activity: group locations by type in the selector 2021-11-25 15:39:30 +01:00
nobohan 0bd0487801 activity: fix the on-the-fly POSTing of the location entity 2021-11-25 15:39:30 +01:00
nobohan d27f085ac9 location: change display in twig 2021-11-25 15:39:30 +01:00
nobohan c7f2717676 activity: new activity: show address in parcours location 2021-11-25 15:39:30 +01:00
nobohan a2f6f2b5cb activity: post new location on-the-fly 2021-11-25 15:39:30 +01:00
nobohan 1b579f7930 activity: label location 2021-11-25 15:39:30 +01:00
nobohan c1a2112d48 activity: add location from concerned person and 3rd parties in the location selector 2021-11-25 15:39:30 +01:00
nobohan 1519fcd4dd activity: add location of the accompanying course 2021-11-25 15:39:30 +01:00
nobohan b808e970ab activity: correct activityController after rebase 2021-11-25 15:39:30 +01:00
nobohan 92e59e211d activity: suggest location based on accompanying period (WIP) 2021-11-25 15:39:30 +01:00
nobohan 7eeb2f2a7d main: LocationType: add new property defaultFor in the admin 2021-11-25 15:39:30 +01:00
nobohan 32af076986 main: locationType: add defaultFor property 2021-11-25 15:39:30 +01:00
nobohan e3040f4bfb correct deprecated activity method 2021-11-25 15:39:30 +01:00
nobohan 1bd6df7ce2 correct deprecated activity method 2021-11-25 15:39:30 +01:00
julienfastre 69e260f0b1 Merge branch 'issue317_add_geom_to_postal_code' into 'master'
Issue317 add geom to postal code

See merge request Chill-Projet/chill-bundles!236
2021-11-25 13:16:36 +00:00
julienfastre 6d67f2706d Merge branch 'feature/add-api-endpoint-for-permission'
See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/232
2021-11-25 14:15:08 +01:00
Mathieu Jaumotte aecd0e33a3 resume page: try alternatives with row/cols placement 2021-11-25 14:11:24 +01:00
Mathieu Jaumotte 4f1c373704 resume page: add persons and others infos 2021-11-25 14:11:24 +01:00
Mathieu Jaumotte 33c7a495c7 #258 add scss asset to manage suggestions lists (add/remove) 2021-11-25 14:08:13 +01:00
Mathieu Jaumotte b09f32b1c2 vue_activity: adapt bloc width, depends of blocs number 2021-11-25 14:08:13 +01:00
julienfastre 032a61b367 update changelog 2021-11-25 12:13:25 +01:00
julienfastre 983cfb646c Merge add_toasters: handle 422 method and add toaster into course editor
See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/221

Squashed commit of the following:

commit 4f68f83aba74a88898779037aeb24d45c622759e
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Thu Nov 25 12:07:37 2021 +0100

    scope in course editor: show toast when error, instead of restoring the
    previous state

commit fdca8c1c87a4972bb6107bb16ab76844a28cae72
Merge: 53d6e68f8 b97f49782
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Nov 24 17:39:27 2021 +0100

    Merge remote-tracking branch 'origin/add_toasters' into add_toasters

commit 53d6e68f8c5e158ac1848403d18146690ffeacf2
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Nov 24 17:38:52 2021 +0100

    better validation messages

commit b97f497822fa6f6057e3b1cf3697044192ea9052
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 24 17:36:59 2021 +0100

    methods added to api.js again so they can be imported in other bundles still. To be refactored later with general makeFetch method?

commit e6089f75b4f66669cbd84f496c3b867901de9c8c
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Nov 24 17:20:05 2021 +0100

    fix validator for participation overlaps

commit e47e6741b9f179dae63f39a596b7ba7410b3ac88
Merge: 25a80fcb2 05385509e
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Wed Nov 24 16:31:50 2021 +0100

    Merge remote-tracking branch 'origin/master' into add_toasters

commit 25a80fcb26cfb3ab7afab0abc1fcb6c0d0af7a6d
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 18:22:35 2021 +0100

    error object/message changed if not 422 or 403

commit 0c602cee8c127ab7f0723819a691a98c4e0615e2
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 17:13:47 2021 +0100

    Toasts displayed with differentiation between different errors

    error objects created accordingly

commit 252e57a06da1101e4ebc025974b247c472b8c2ed
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 17:12:55 2021 +0100

    generic makeFetch implemented almost everywhere

    api.js file no longer needs to contain a separate function to make an api call.

commit 8532eeee7656f6f9761168fb5e2102778ee932b7
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 17:10:48 2021 +0100

    Moved generic api methods into one file apiMethods.js

     imports adapted throughout bundles

commit c44bd5e75b32d5fbc8951247324ebf5fb85f3b37
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 11:27:24 2021 +0100

    migration deleted

commit dbeee090f46b3653c306a1825dcb05637e1f9b31
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 11:27:13 2021 +0100

    toast plugin initialized with options in the root

commit ec3919e357ee26f6c5016360d2083d19688217f4
Merge: 1ab401b5d b8889ed58
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 10:52:24 2021 +0100

    merge conflicts fixed

commit 1ab401b5d55a28f9c027ee539da58ef1da3d797c
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 23 10:40:02 2021 +0100

    add options when vue toast plugin is loaded

commit ad4e630bdd87c8ec16455bab0c2b053c1d838050
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Mon Nov 22 18:58:44 2021 +0100

    fixes to throw and catch error

commit 1c19748866d738bcb9e336f1035d9d78c6941d34
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 20:22:06 2021 +0100

    toast added to banner

commit 35949b90532b60161e14e815a78b3b69b053b62d
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 20:16:35 2021 +0100

    few more actions using makeFetch

commit e94c13e396f496565955294aec360db37f92374b
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 19:48:58 2021 +0100

    For accompanyingcourse app general makeFetch + displayToast implemented

commit 35eac75edf2c8d39ee2a04f119bb99a946fe3ea9
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 17:12:31 2021 +0100

    general makeFetch method implemented + toasts displayed in progress

commit 541bb10547bd7b96815a22a755ecf7f809d8cc87
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 12:36:20 2021 +0100

    general fetch method adjusted and tested on addParticipation: works

commit b7f27e8079bc815d88ffc925ec7a4fae3fba5f02
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 11:50:09 2021 +0100

    changelog updated

commit 028519ee3e93991aeb3131656e5f17e728ebdb1c
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 11:42:55 2021 +0100

    adjustment of error message using templating render

commit 508139b4476a46028a40b0b5300a8c65f79414a9
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 11:41:52 2021 +0100

    toast display for 422 errors on participations, requestor, resources + bugfix in requestor component (display of 'remove' btn if non-anonymous

commit 3e5d4862fcbbf5708f52c0038bf030dc0cbae5bb
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 15:38:03 2021 +0100

    debugging fetch method

commit 8b971a2357aac952ea6cd9487da20f4064c26a8d
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 14:31:45 2021 +0100

    general fetch method in _abstratAPI and testcase implementation; still needs to take care of commit into store

commit 05488740ab138ed279a4626310c5427d9f732793
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 11:13:28 2021 +0100

    testcase: toaster working when adding a resource to an accompanying course. Needs to be generalized

commit 5050e8a516107710216fa11aafcf852c52e1eb03
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 09:22:36 2021 +0100

    start of toaster popup

commit b8889ed58d3abb68d1c2859b31bf7428addda36e
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Mon Nov 22 18:58:44 2021 +0100

    fixes to throw and catch error

commit 0c017eb908e65919876d3bed69d3daa27699f2cc
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 20:22:06 2021 +0100

    toast added to banner

commit 80d8c5f12be4b0cfcded2948f385b4e3627e9afb
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 20:16:35 2021 +0100

    few more actions using makeFetch

commit 9cfcc61d995f75651902af97fe640f00f994ce9b
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 19:48:58 2021 +0100

    For accompanyingcourse app general makeFetch + displayToast implemented

commit 2855b0293a4a3fef2baf22fa035316bac13abf3f
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 17:12:31 2021 +0100

    general makeFetch method implemented + toasts displayed in progress

commit febbc8b9cdd9ec811546ce2948e2e1bded7c2116
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 12:36:20 2021 +0100

    general fetch method adjusted and tested on addParticipation: works

commit 16b59681b97cf995689aa464ae2a310c3efbb603
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 11:50:09 2021 +0100

    changelog updated

commit 41df29bdef84af010892708bfd0e37ff826f7aee
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 11:42:55 2021 +0100

    adjustment of error message using templating render

commit 8c98fe602c26e61285f12f5f7d58d646655f4caa
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Wed Nov 17 11:41:52 2021 +0100

    toast display for 422 errors on participations, requestor, resources + bugfix in requestor component (display of 'remove' btn if non-anonymous

commit 689ca8aa0ac249d577fe2ead5b3fcc0298dbad90
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 15:38:03 2021 +0100

    debugging fetch method

commit 07234c5fa996fb9f0352719ee366b34b093807eb
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 14:31:45 2021 +0100

    general fetch method in _abstratAPI and testcase implementation; still needs to take care of commit into store

commit 2a482516e952aa720b5aa8b4cb68ab33f93ce47b
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 11:13:28 2021 +0100

    testcase: toaster working when adding a resource to an accompanying course. Needs to be generalized

commit b7dcc5e7d4b1489a8edc175a0c2c1b0d649c6c0f
Author: Julie Lenaerts <julielenaerts@gmail.com>
Date:   Tue Nov 16 09:22:36 2021 +0100

    start of toaster popup
2021-11-25 12:12:43 +01:00
nobohan b594826f1e upd CHANGELOG 2021-11-24 17:44:51 +01:00
nobohan 4c4ba73c89 address: translate multi-select messages 2021-11-24 17:41:58 +01:00
nobohan 5781f2af89 main: add the coordinates of the postal code if no full address is selected 2021-11-24 17:21:43 +01:00
Mathieu Jaumotte 92753604fa fix backend error in activity::getPersonsNotAssociated() 2021-11-24 17:03:35 +01:00
julienfastre 8a0d16dc53 Merge branch 'bugfix/accompanying-period-filter-list-by-person-using-acl' into 'master'
List for accompanying course for a person: filter using acl

See merge request Chill-Projet/chill-bundles!235
2021-11-24 15:55:45 +00:00
julienfastre 551486b5ea List for accompanying course for a person: filter using acl 2021-11-24 15:55:45 +00:00
julienfastre 09a96df6a4 update changelog 2021-11-24 16:16:40 +01:00
julienfastre 153576df70 Merge remote-tracking branch 'origin/master' into feature/add-api-endpoint-for-permission 2021-11-24 16:15:51 +01:00
julienfastre 05385509ef Merge branch 'issue310_activity-acl-on-button' into 'master'
check acl before showing button for creating activity in person/activity

See merge request Chill-Projet/chill-bundles!234
2021-11-24 15:14:07 +00:00
julienfastre b81c834b5e check acl before showing button for creating activity in person/activity 2021-11-24 15:14:06 +00:00
julienfastre 5be3b3f423 Merge branch 'bugfix/person-has-center-fix-tests' into 'master'
remove deprecation on PersonHasCenterValidator and fix tests

See merge request Chill-Projet/chill-bundles!233
2021-11-24 14:20:17 +00:00
julienfastre a2681a02f9 remove deprecation on PersonHasCenterValidator and fix tests 2021-11-24 14:20:17 +00:00
Mathieu Jaumotte 95e306ccd6 Merge branch 'master' into 295_resume_retouches 2021-11-24 13:52:55 +01:00
julielenaerts 41f0578966 changelog updated 2021-11-24 12:01:57 +01:00
julielenaerts cd9ce1b458 link to thirdparty resume page fixed 2021-11-24 11:59:11 +01:00
Mathieu Jaumotte 00fb82664f Merge branch 'master' into 295_resume_retouches 2021-11-24 11:47:47 +01:00
julienfastre 9993bfc96f fix cs and add test 2021-11-23 23:28:56 +01:00
julienfastre fdbaa8cbef add endpoint for getting permissions info 2021-11-23 23:04:29 +01:00
julienfastre d0856a9a39 reformat to 4 spaces 2021-11-23 22:53:11 +01:00
Pol Dellaiera d933a30847 ci: Enable PHPCSFixer diff on CI. 2021-11-23 16:21:27 +01:00
Pol Dellaiera e209e5c186 chore: Remove PHPStan dependency - added by drupol/php-conventions. 2021-11-23 15:32:15 +01:00
Pol Dellaiera 0248dddc9e cs: Fix AccompanyingCourseController. 2021-11-23 15:25:12 +01:00
Pol Dellaiera cd55e80275 ci: Update Gitlab CI. 2021-11-23 15:19:01 +01:00
Pol Dellaiera d586f848f5 chore: Update PHPStan configuration - add deprecations baseline. 2021-11-23 15:19:01 +01:00
Pol Dellaiera ffbd572513 chore: Update .gitignore - add dev paths to ignore. 2021-11-23 15:19:01 +01:00
julienfastre f23be44b9a fix: show validation message when closing course 2021-11-23 15:06:55 +01:00
julienfastre da8422d0a7 use full text representation for referre in course banner 2021-11-23 15:06:55 +01:00
Pol Dellaiera a2c209a857 cs: Third and last part. 2021-11-23 14:45:31 +01:00
Pol Dellaiera 3ea35682eb cs: Second part - ignore test/app subdirectory. 2021-11-23 14:34:34 +01:00
Pol Dellaiera 5f37304796 cs: Remove "...use self;...". 2021-11-23 14:28:14 +01:00
Pol Dellaiera 1ddef0e232 cs: Add missing configuration file. 2021-11-23 14:27:50 +01:00
Pol Dellaiera c288e11cb8 Update submodule. 2021-11-23 14:22:51 +01:00
Pol Dellaiera 4bd2894c4f ci: Update CI add Code Style stage. 2021-11-23 14:10:12 +01:00
Pol Dellaiera 8f96a1121d cs: Fix code style (safe rules only). 2021-11-23 14:08:50 +01:00
Pol Dellaiera 149d7ce991 chore: Add/update static files. 2021-11-23 14:05:45 +01:00
Pol Dellaiera 9c167df78a sa: Fix SA issues. 2021-11-23 12:49:20 +01:00
Pol Dellaiera ba9e5d10b5 Merge branch 'ci-update' 2021-11-23 12:42:12 +01:00
Pol Dellaiera 70ed9e75db tests: Fix "...Class "Chill\MainBundle\Security\Resolver\CenterResolverDispatcher" is declared "final" and cannot be mocked....". 2021-11-23 12:41:09 +01:00
Pol Dellaiera 45063fa6fe sa: Fix "...Variable property access on string...". 2021-11-23 12:41:03 +01:00
Pol Dellaiera c5da567480 Update CI. 2021-11-23 12:39:38 +01:00
Pol Dellaiera 1e804f351c fix: Strict types interfaces: VoterHelperInterface, ProvideRoleHierarchyInterface and ProvideRoleInterface. 2021-11-23 11:39:45 +01:00
Pol Dellaiera 328b4c4596 fix: Strict types interfaces: VoterHelperInterface, ProvideRoleHierarchyInterface and ProvideRoleInterface. 2021-11-23 10:40:34 +01:00
julienfastre 05dda33a7a Activity: fixes in voter
* the role CREATE is now transformed to CREATE_ACCOMPANYING_COURSE or
CREATE_PERSON when the subject is, respectively, a course or a person;
* the button at the list of activities is now labeled "create"
* the role FULL give access to both role
acTIVITY_CREATE_ACCOMPANYING_COURSE and ACTIVITY_CREATE_PERSON, but not
ACTIVITY_CREATE directly.
2021-11-23 09:06:05 +01:00
julienfastre f9b33fdfb8 change definition of person involved: add all periods which are not closed 2021-11-23 09:05:36 +01:00
julienfastre 3eaa8494cd update changelog 2021-11-22 21:42:21 +01:00
julienfastre 0867965d9c Minor fixes for closing accompanying course:
* check that transition can be applyied in menu;
* change organisation for activityVoter, and check for authorization in
    Activity Controller
* fix label 'create' in accompanying course document
* minor fix in accompanying course document voter
* change color when course is closed and show old user, and startdate /
    enddate
2021-11-22 20:24:08 +01:00
julienfastre 4c1e416a14 Merge remote-tracking branch 'origin/master' into issue296_internal_close_accourse 2021-11-22 17:14:11 +01:00
Mathieu Jaumotte e43d22c1e0 resume: improve resources bloc 2021-11-22 17:02:08 +01:00
julienfastre 6028167513 allow the case when the referrer is null 2021-11-22 16:33:36 +01:00
Mathieu Jaumotte 21b33fb4f6 accourse resume page: add requestor and resources informations 2021-11-22 15:05:52 +01:00
julienfastre f3792b2ed6 Merge remote-tracking branch 'origin/master' into issue294_suggestPersonInActivity 2021-11-22 14:06:27 +01:00
julienfastre 764bb6a21f fixes for settign a localisation 2021-11-22 13:43:33 +01:00
julienfastre 69384a84d1 Merge remote-tracking branch 'origin/master' into issue133_user_current_location 2021-11-22 13:43:22 +01:00
julienfastre 99d412adc9 Merge branch 'bugfix/person-json-normalization-circular-reference' into 'master'
fix circular reference in center normalization

See merge request Chill-Projet/chill-bundles!229
2021-11-22 12:02:23 +00:00
julienfastre 2826e079e8 key "centers" for person is an array. key center deprecated 2021-11-22 12:59:36 +01:00
julienfastre b43a3d394b fix circular reference in center normalization 2021-11-22 12:41:47 +01:00
julienfastre fe3d4e1f0a fix return type for center resolver 2021-11-22 12:22:28 +01:00
julienfastre 4664394a89 Merge commit '98760bc5' 2021-11-22 11:10:51 +01:00
julienfastre 94b0e365e3 fix down migration 2021-11-22 11:01:55 +01:00
julienfastre 130deb26f3 fix banner and person entity render block with multiple centers 2021-11-22 11:01:51 +01:00
julienfastre 98760bc5e8 Merge remote-tracking branch 'origin/master' into doc/authorizaton-documentation-update 2021-11-22 10:30:05 +01:00
julielenaerts 2c74e268d3 voter fixes 2021-11-22 10:19:14 +01:00
Mathieu Jaumotte 1194aaecaf Merge branch 'master' into 295_resume_retouches 2021-11-22 10:08:06 +01:00
Mathieu Jaumotte f69d6edba3 accourse banner carousel: slide2 control on right, + display when ready 2021-11-22 10:05:34 +01:00
julienfastre 009a093b9d Merge branch 'features/docgen-normalization' into 'master'
Bootstrap encoder for documents

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

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

# Description of changes

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

# Issues related

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

# Tests

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

See merge request Chill-Projet/chill-bundles!225
2021-11-19 17:09:05 +00:00
Mathieu Jaumotte 31ec155070 update changelog 2021-11-19 17:27:53 +01:00
Mathieu Jaumotte 89c2d74c33 Merge branch 'master' into 295_resume_retouches 2021-11-19 17:22:00 +01:00
Mathieu Jaumotte af339aa7f0 accourse banner: use bootstrap carousel to display vue_accourse social-issues and associated-persons as slides 2021-11-19 17:16:16 +01:00
nobohan 264b902db5 upd CHANGELOG 2021-11-19 14:50:55 +01:00
nobohan f1113ee448 accompanying course: add client-side validation if no origin 2021-11-19 14:48:31 +01:00
nobohan 3ce3613c71 activity: change name of property type in activityType to allow property 'type' in the serializer (by DiscriminatorMap) 2021-11-19 14:12:41 +01:00
nobohan 4645244975 upd CHANGELOG 2021-11-19 13:42:59 +01:00
nobohan d89a948fa1 activity: generalise concernedGroups component for use with calendar 2021-11-19 13:28:35 +01:00
nobohan aa53df8bb0 activity: avoid adding persons|Users|Thirdparty if not allowed 2021-11-19 13:28:35 +01:00
nobohan f5a6314ca2 calendar: can add User from suggested entities 2021-11-19 13:28:35 +01:00
nobohan bdb24750ab calendar: remove done TODO 2021-11-19 13:28:35 +01:00
nobohan 631ffa02f7 calendar: add suggestion for concernedGroups 2021-11-19 13:28:35 +01:00
nobohan d0e9829a3c activity: fix links to third party view page 2021-11-19 13:28:35 +01:00
nobohan e40ea6902c calendar: fix type hinting in Calendar controller 2021-11-19 13:28:35 +01:00
nobohan aae7d2fb2a activity: naming of addSuggestedEntities 2021-11-19 13:28:35 +01:00
nobohan b3cd7c5cdb activity: suggest requestor, user and ressources for adding persons|user|3rdparty 2021-11-19 13:28:35 +01:00
nobohan 909e2ca070 activity: delete admin_user_show in twig template because this route is not defined and should not be defined 2021-11-19 13:28:35 +01:00
julielenaerts 9e75c7e9b2 Merge branch 'issue296_internal_close_accourse' of gitlab.com:Chill-Projet/chill-bundles into issue296_internal_close_accourse 2021-11-19 12:43:49 +01:00
julielenaerts 167b7b20d1 change menu entry order 2021-11-19 12:43:14 +01:00
julielenaerts f145d6c921 voters adjusted 2021-11-19 12:43:14 +01:00
julielenaerts fc8a766c25 badge adapted+ menu entry + persistance of object fixed 2021-11-19 12:43:14 +01:00
julielenaerts 57cf46a0af adjustment to apply validation 2021-11-19 12:43:14 +01:00
julielenaerts a20d7222a8 transition added + attempt voter 2021-11-19 12:43:14 +01:00
julielenaerts e9e3b85518 changelog updated 2021-11-19 12:43:14 +01:00
julielenaerts e38729aa65 use statement fix 2021-11-19 12:43:14 +01:00
julielenaerts 5928215c0d closed step added + form/controller/template basic start 2021-11-19 12:43:14 +01:00
Pol Dellaiera 0a522b465f fix: Update typing information. 2021-11-19 12:32:21 +01:00
Pol Dellaiera 693b59c484 fix: Fix wrong repository. 2021-11-19 12:32:05 +01:00
Pol Dellaiera 5a6a15a351 fix: Add missing repository. 2021-11-19 12:31:48 +01:00
julielenaerts 7fe316b49a change menu entry order 2021-11-19 11:35:31 +01:00
julielenaerts 210c8b8b97 voters adjusted 2021-11-19 11:29:29 +01:00
julielenaerts 26a13ae6df badge adapted+ menu entry + persistance of object fixed 2021-11-19 09:46:24 +01:00
julielenaerts f2bf88ec90 adjustment to apply validation 2021-11-19 08:45:28 +01:00
julielenaerts 6c48a22f86 transition added + attempt voter 2021-11-19 08:37:56 +01:00
Mathieu Jaumotte aba47600ff hop 2021-11-18 17:56:46 +01:00
Mathieu Jaumotte a600196151 vue_accourse referrer: style for suggestions, add and remove items 2021-11-18 16:25:36 +01:00
Mathieu Jaumotte 193d0fb94a vue_activity: style for suggestions, add and remove items 2021-11-18 16:02:40 +01:00
Mathieu Jaumotte c7ffb7062a improve resume course styles 2021-11-18 16:02:09 +01:00
Pol Dellaiera d1935f96e7 fix: Add more typing informations. 2021-11-18 15:23:44 +01:00
Pol Dellaiera 17ef963924 fix: Fix wrong entity class and a few other fixes. 2021-11-18 15:15:51 +01:00
julielenaerts dcbed94050 changelog updated 2021-11-18 15:01:03 +01:00
julielenaerts 6db180e7ca use statement fix 2021-11-18 14:56:59 +01:00
Pol Dellaiera 597a12b085 fix: Get rid of obsolete import. 2021-11-18 14:50:16 +01:00
Pol Dellaiera 56b15f26b2 fix: Get rid of a single PHPStan critical issue. 2021-11-18 14:47:58 +01:00
julielenaerts ce5af04df7 closed step added + form/controller/template basic start 2021-11-18 14:46:33 +01:00
Pol Dellaiera 7a07b8bef7 fix: Autowire and autoconfigure the new service. 2021-11-18 14:45:32 +01:00
Pol Dellaiera 1509fcc2e9 fix: Fix tests. 2021-11-18 14:33:14 +01:00
Pol Dellaiera 7fd45d5735 fix: Remove deprecations. 2021-11-18 14:33:06 +01:00
Pol Dellaiera ae79ebc299 fix: Strict type RoleScope. 2021-11-18 14:29:11 +01:00
Pol Dellaiera 162db60f59 fix: Fix FamilyMemberController and Repository. 2021-11-18 14:28:51 +01:00
Pol Dellaiera dfc853a876 fix: Replace tabs with spaces. 2021-11-18 14:16:02 +01:00
Pol Dellaiera 674bf614dd fix: Add a deprecation and the new service that goes with it as replacement. 2021-11-18 14:15:51 +01:00
Pol Dellaiera 370a24d3f5 fix: Fix PHPStan issues. 2021-11-18 12:36:50 +01:00
Pol Dellaiera 1e05bd31d8 fix: Fix bug reported by the tests. 2021-11-18 12:18:16 +01:00
Pol Dellaiera 11ad94ee09 fix: Fix bug reported by the tests. 2021-11-18 12:17:04 +01:00
Pol Dellaiera c1a4454a08 fix: Fix bug reported by the tests. 2021-11-18 12:10:54 +01:00
Pol Dellaiera f9d36cc8a9 fix: Fix bug reported by the tests. 2021-11-18 12:03:49 +01:00
Pol Dellaiera a32692c37a fix: RoleScope might or might not have a Scope. 2021-11-18 11:48:35 +01:00
Pol Dellaiera 6ccc8d4cb8 fix: Let Symfony inject dependencies automatically. 2021-11-18 11:46:30 +01:00
Pol Dellaiera d9b862925f fix: Let Symfony inject dependencies automatically. 2021-11-18 11:41:41 +01:00
Pol Dellaiera 7dcf0f8dcf fix: Inject newly created repository instead of having to deal with the container definitions. 2021-11-18 11:41:41 +01:00
Pol Dellaiera 97ab71b63d fix: Add missing repositories, fix typing information, autoload Repository directory. 2021-11-18 11:41:40 +01:00
Pol Dellaiera b722106616 fix: Use TranslatableStringHelperInterface. 2021-11-18 11:41:40 +01:00
Pol Dellaiera cc9ce4167f fix: Upgrade TranslatableStringHelper service and create its interface. 2021-11-18 11:41:40 +01:00
Pol Dellaiera 9f06bc7126 fix: Autowire and autoconfigure services in chill_main.
This commit does not remove services that are not automatically PSR loaded.
2021-11-18 11:41:40 +01:00
nobohan be92ac4a08 user: correct dependency injection for form for locationType and userCurrentLocation 2021-11-18 11:26:14 +01:00
julielenaerts 78615519f4 select2 field added to task form 2021-11-18 09:34:52 +01:00
Pol Dellaiera d1e1f7faa4 Revert "fix: Autowire and autoconfigure services in chill_main."
This reverts commit d7fbbbf92c.
2021-11-18 08:34:17 +01:00
Pol Dellaiera d7fbbbf92c fix: Autowire and autoconfigure services in chill_main. 2021-11-17 20:31:35 +01:00
Pol Dellaiera d830b19756 fix: Enforce (and document) the type of property. 2021-11-17 20:31:35 +01:00
Mathieu Jaumotte 2492a9281f improve household button in course participation 2021-11-17 16:06:55 +01:00
Mathieu Jaumotte 0e98010d0e #101 improve translations + hide title 2021-11-17 16:06:42 +01:00
nobohan 11b82f7468 upd CHANGELOG 2021-11-17 15:22:55 +01:00
nobohan 63e5220084 activity: add user current location as default for a new activity 2021-11-17 15:21:53 +01:00
nobohan cd4de2e244 activity: fix type error + add new property for new form 2021-11-17 15:19:24 +01:00
nobohan f0ff4c18af upd CHANGELOG 2021-11-17 14:20:18 +01:00
nobohan 593817f12e user: refine display of location name (as usual, service injection does not work) 2021-11-17 14:12:22 +01:00
nobohan 480e02af01 user: add change location for user in user menu 2021-11-17 13:54:32 +01:00
Mathieu Jaumotte 1a04973072 visgraph: refresh after post/patch/delete request, fix missing key in POST body parameter 2021-11-17 12:20:43 +01:00
Pol Dellaiera 4f56bb2464 fix: Creation of entity in createEntity().
Issue introduced in 5432242376.
2021-11-17 11:58:15 +01:00
Pol Dellaiera afa8d7cb72 fix: Creation of entity in createEntity().
Issue introduced in 5432242376.
2021-11-17 11:46:28 +01:00
nobohan 5905038425 user: current location edit form and page 2021-11-17 11:35:54 +01:00
Mathieu Jaumotte 5d74b3ab0a fix errors when clearing cache 2021-11-17 10:58:52 +01:00
Pol Dellaiera 7f02130ff2 fix: Return type of getAge().
Issue highlighted by c68bda5c9b.
2021-11-16 20:58:28 +01:00
nobohan 32c7695d80 user: correct property name 2021-11-16 17:51:05 +01:00
nobohan 02f6a1d110 user: add location to user entity 2021-11-16 17:35:58 +01:00
Pol Dellaiera 5432242376 fix: SA: Fix many critical rules.
SA stands for Static Analysis.
2021-11-16 17:13:39 +01:00
Pol Dellaiera db2010082a fix: SA: Fix "...Access to an undefined property..." rule.
SA stands for Static Analysis.
2021-11-16 16:37:45 +01:00
Pol Dellaiera 6cfcf91757 fix: Follow up f8aeb08594 and fix parameters type. 2021-11-16 16:28:20 +01:00
Pol Dellaiera f11df95f59 fix: Follow up 8879734ea2 and fix service definition. 2021-11-16 15:46:33 +01:00
Pol Dellaiera 68a21fcc0a fix: SA: Fix "...Instantiated class not found..." rules.
SA stands for Static Analysis.
2021-11-16 15:34:12 +01:00
Pol Dellaiera 8879734ea2 fix: SA: Fix "...does not call parent constructor... and ...Access to an undefined property..." rules.
SA stands for Static Analysis.
2021-11-16 15:30:53 +01:00
Pol Dellaiera a17c22c74f fix: SA: Fix "...does not call parent constructor...." rule.
SA stands for Static Analysis.
2021-11-16 15:27:46 +01:00
Pol Dellaiera 75d2d50dd2 fix: SA: Fix "...Variable in isset() is never defined...." rule.
SA stands for Static Analysis.
2021-11-16 15:25:48 +01:00
Pol Dellaiera c94fb2efbf fix: SA: Fix "...variable always exists and is not falsy...." rule.
SA stands for Static Analysis.
2021-11-16 15:23:56 +01:00
Pol Dellaiera 11651fdb2a fix: SA: Fix "...does not call parent constructor...." rule.
SA stands for Static Analysis.
2021-11-16 15:21:26 +01:00
Pol Dellaiera d382cf35ba fix: SA: Fix "...Variable in isset() is never defined...." rule.
SA stands for Static Analysis.
2021-11-16 15:18:59 +01:00
Pol Dellaiera 479f0ce9ed fix: SA: Fix "...does not match parent method..." rule.
SA stands for Static Analysis.
2021-11-16 15:17:29 +01:00
Pol Dellaiera e2a8437807 fix: SA: Fix "...Short ternary operator..." rule.
SA stands for Static Analysis.
2021-11-16 15:14:43 +01:00
Pol Dellaiera 5a85d497ab fix: SA: Fix "...Switch condition type..." rule.
Also fix a critical bug in `ReportList.php`.

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

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

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

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

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

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

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

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

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

This PR: Add basic configuration files with basic baseline.


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


# Description of changes

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

```json
{

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

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

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

This `CenterResolverDispatcher` is now used into person normalization.

As a consequence, the center may now be:

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

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



# Issues related

Any issue related.

# Tests

Any new tests.

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

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


# Description of changes

End date field removed from household edit form.


# Issues related

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

# Tests

No tests

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


# Description of changes

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


# Issues related

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

# Tests

Not yet written

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


# Description of changes

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


# Issues related

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

# Tests

Any new tests

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


# Description of changes

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



# Issues related


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

# Tests

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

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


# Description of changes

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


# Issues related

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

# Tests

No tests written.

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


# Description of changes

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


# Issues related

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

# Tests

No tests.

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


# Description of changes

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

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


# Issues related

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

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

no issues related

# Tests

The tests for listing task does apply

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

See merge request Chill-Projet/chill-bundles!157
2021-09-29 12:05:31 +00:00
julienfastre 0ec095b59a allow to remove / update address in household member editor 2021-09-29 13:57:36 +02:00
Mathieu Jaumotte 86c5376cc2 bypass ACL restriction
fix response 500 when otf create new person
2021-09-29 13:35:33 +02:00
julienfastre 0e54b8cdf0 add a changelog 2021-09-29 13:26:54 +02:00
julienfastre 53e82f1b2a store created address into new household 2021-09-29 12:54:53 +02:00
julienfastre f4999548ac handle suggestion in addAddress component 2021-09-29 12:48:18 +02:00
Mathieu Jaumotte 302f60e722 addAddress: remove commented old method 2021-09-29 12:14:58 +02:00
Mathieu Jaumotte 5b7484b1ce Merge branch 'onTheFly' of gitlab.com:Chill-Projet/chill-bundles into onTheFly 2021-09-29 11:42:40 +02:00
julielenaerts fc1dd499c4 POST, PUT, PATCH working for thirdparty and added to swagger. Assert for 'centers'(temporarily) removed from thirdparty entity 2021-09-29 11:41:08 +02:00
Mathieu Jaumotte 3824a380ff otf: prepare with debug (wip) 2021-09-29 11:37:53 +02:00
julienfastre 315253589e create api endpoint for duplciating address 2021-09-29 11:32:23 +02:00
julienfastre af24637dc4 update return type for prepare client trait 2021-09-29 11:31:44 +02:00
Mathieu Jaumotte 0fe248320d OnTheFly (otf): fix clickable radio tab on create modal 2021-09-29 11:21:45 +02:00
Mathieu Jaumotte a26d278510 comment console.log 2021-09-29 11:21:06 +02:00
julienfastre 9641fd3fcc WIP add address to new household 2021-09-28 23:06:59 +02:00
julienfastre 2b3c4b7af9 fix boundary in getCurrentMembers/getNonCurrentMembers 2021-09-28 23:06:40 +02:00
julienfastre 8853359405 remove dump
(cherry picked from commit e2230409b8)
2021-09-28 19:38:02 +00:00
julienfastre 704ec76ca4 rewrite the destination for household / leave household 2021-09-28 21:35:41 +02:00
Pol Dellaiera 6020ee2cb2 chore: Update .editorconfig file. 2021-09-28 20:35:19 +02:00
Pol Dellaiera ba53ce40fa Add migration file. 2021-09-28 20:32:43 +02:00
Pol Dellaiera ab845d4569 Synchronize ChillWopiBundle with latest upstream WOPI packages. 2021-09-28 17:50:53 +02:00
Pol Dellaiera dcb92b1378 Update StoredObject entity. 2021-09-28 17:49:32 +02:00
Pol Dellaiera 59fcd1e96b Update local ChillDocStore composer.json. 2021-09-28 17:40:49 +02:00
Pol Dellaiera 0aec2fc1d1 Update local ChillWopiBundle composer.json. 2021-09-28 17:39:54 +02:00
Pol Dellaiera e43ae56e73 Update root composer.json. 2021-09-28 17:39:23 +02:00
Mathieu Jaumotte 3040ed9483 tp onthefly: add add-address (wip) 2021-09-28 16:26:59 +02:00
Mathieu Jaumotte adc94aaeea javascript syntax correction 2021-09-28 16:26:32 +02:00
Mathieu Jaumotte c5fa1b883c onthefly: adding tp i18n file 2021-09-28 16:25:38 +02:00
julielenaerts 644d0420ce creation of endpoints POST, PUT, PATCH, but still errors 2021-09-28 16:23:24 +02:00
julienfastre e2230409b8 remove dump 2021-09-28 15:59:31 +02:00
julienfastre 472866ce91 fix search by birthdate 2021-09-28 15:54:09 +02:00
julienfastre d5d12c4a17 fix tests for user controller 2021-09-28 15:54:08 +02:00
Mathieu Jaumotte e72ba4c940 bypass ACL restriction 2021-09-28 15:34:15 +02:00
nobohan ca7ba90717 hotfix: repair creation activity (was an error linked to ListenToActivityCreate) 2021-09-28 14:53:00 +02:00
Mathieu Jaumotte f3ba3aeed9 Merge branch 'master' into thirdparty 2021-09-28 14:47:52 +02:00
Mathieu Jaumotte c791c48248 tp: adapt to new ACL interface (wip) 2021-09-28 14:06:52 +02:00
Mathieu Jaumotte 5da332a06e fix error on previous commit, when creating new accourse 2021-09-27 13:14:42 +02:00
Mathieu Jaumotte eb89fa2cd4 CourseLocation: replace in accourse vue component the old resume _warning_address.html.twig message 2021-09-27 13:03:17 +02:00
Mathieu Jaumotte 82db55cfec CourseLocation: change add-address key, cleaning add-address options 2021-09-27 11:18:11 +02:00
Mathieu Jaumotte 349a0e69f1 accourse: add warning alert box in each bloc with minimum confirm conditions 2021-09-27 10:56:43 +02:00
Mathieu Jaumotte 4de106ec30 accourse service: improve styles of checkboxes list 2021-09-27 10:21:11 +02:00
julielenaerts 6301c4c10b optimisation twig template 2021-09-24 14:42:37 +02:00
julielenaerts b87c995d22 fix UserMenuBuilder so that menu entry is not visible for admin menu 2021-09-24 14:42:07 +02:00
julielenaerts 960db6aefc fast aside activity creation implemented 2021-09-24 14:41:37 +02:00
julielenaerts a28c996164 stash commit 2 2021-09-23 14:55:54 +02:00
julielenaerts 05c5eaa925 stash commit 2021-09-23 14:54:11 +02:00
julielenaerts d4116a4659 Merge branch 'master' into improvements_acitivite_annexe 2021-09-23 14:39:39 +02:00
julielenaerts 15897b4f33 asideactivity category entity changed to have parent and children properties 2021-09-22 20:35:46 +02:00
julielenaerts aa1f02ebd4 style of aside activity list adapted 2021-09-22 16:23:31 +02:00
julielenaerts 1672e873a3 view page created for aside activity 2021-09-22 16:23:11 +02:00
julielenaerts 544af59009 configuration of duration parametres for aside activity 2021-09-22 15:10:09 +02:00
julielenaerts edc528ff92 Fixed migration 2021-09-22 10:06:58 +02:00
julielenaerts 62e70c0c36 Fix layout of flash message in main template 2021-09-21 15:12:25 +02:00
julielenaerts f2e945dc0f UserMenu entry added for aside activities list 2021-09-21 11:52:45 +02:00
julielenaerts d2ce4865c0 display all aside activities created for and created by user with temporary badge 2021-09-21 11:42:18 +02:00
julielenaerts 601c16ac27 first commit: rendez-vous menu entry deleted from task usermenubuilder. Start sous-types 2021-09-17 17:00:23 +02:00
2040 changed files with 131183 additions and 76656 deletions
+1
View File
@@ -7,6 +7,7 @@ charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
[*.{php,html,twig}]
indent_style = space
-64
View File
@@ -1,64 +0,0 @@
##
## Manually dump .env files in .env.local.php with
## `$ composer symfony:dump-env prod`
##
## Project environment
APP_ENV=dev
## Enable debug
APP_DEBUG=true
## Locale
LOCALE=fr
## Framework secret
APP_SECRET=ThisTokenIsNotSoSecretChangeIt
## Symfony/swiftmailer
MAILER_TRANSPORT=smtp
MAILER_HOST=smtp
MAILER_PORT=1025
MAILER_CRYPT=
MAILER_AUTH=
MAILER_USER=
MAILER_PASSWORD=
MAILER_URL=${MAILER_TRANSPORT}://${MAILER_HOST}:${MAILER_PORT}?encryption=${MAILER_CRYPT}&auth_mode=${MAILER_AUTH}&username=${MAILER_USER}&password=${MAILER_PASSWORD}
## Notifications
NOTIFICATION_HOST=localhost:8001
NOTIFICATION_FROM_EMAIL=admin@chill.social
NOTIFICATION_FROM_NAME=Chill
## Gelf
GELF_HOST=gelf
GELF_PORT=12201
## OVH OpenStack Storage User/Role
OS_USERNAME=
OS_PASSWORD=
OS_TENANT_ID=
OS_REGION_NAME=GRA
OS_AUTH_URL=https://auth.cloud.ovh.net/v2.0/
## OVH OpenStack Storage Container
ASYNC_UPLOAD_TEMP_URL_KEY=
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
## Redis Cache
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
## Twilio
TWILIO_SID=~
TWILIO_SECRET=~
## DOCKER IMAGES REGISTRY
#IMAGE_PHP=
#IMAGE_NGINX=
## DOCKER IMAGES VERSION
#VERSION=test
VERSION=prod
-1
View File
@@ -3,4 +3,3 @@
# Run tests from root to adapt your own environment
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
+2
View File
@@ -20,3 +20,5 @@ docs/build/
.phpunit.result.cache
###< phpunit/phpunit ###
/.php-cs-fixer.cache
/.idea/
+89 -35
View File
@@ -1,48 +1,102 @@
---
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
# Select what we should cache between builds
cache:
paths:
- tests/app/vendor/
- .composer
before_script:
# add extensions to postgres
- PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h db -c "CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
# Install and run Composer
- mkdir -p $COMPOSER_HOME
- curl -sS https://getcomposer.org/installer | php
- php -d memory_limit=2G composer.phar install
- php tests/app/bin/console doctrine:migrations:migrate -n
- php -d memory_limit=2G tests/app/bin/console doctrine:fixtures:load -n
- echo "before_script finished"
paths:
- tests/app/vendor/
- .cache
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
# See http://docs.gitlab.com/ee/ci/services/README.html for examples.
services:
- name: postgis/postgis:12-3.1-alpine
alias: db
- name: redis
alias: redis
- name: postgis/postgis:12-3.1-alpine
alias: db
- name: redis
alias: redis
# Set any variables we need
variables:
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# fetch the chill-app using git submodules
GIT_SUBMODULE_STRATEGY: recursive
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_URL: redis://redis:6379
# change vendor dir to make the app install into tests/apps
COMPOSER_VENDOR_DIR: tests/app/vendor
# cache some composer data
COMPOSER_HOME: .composer
GIT_DEPTH: 1
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# configure database access
DATABASE_URL: postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
# fetch the chill-app using git submodules
GIT_SUBMODULE_STRATEGY: recursive
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_URL: redis://redis:6379
# change vendor dir to make the app install into tests/apps
COMPOSER_VENDOR_DIR: tests/app/vendor
DEFAULT_CARRIER_CODE: BE
stages:
- Composer install
- Tests
# Run our tests
test:
script:
- php -d memory_limit=3G bin/phpunit --colors=never
build:
stage: Composer install
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
before_script:
- curl -sS https://getcomposer.org/installer | php
- php -d memory_limit=2G composer.phar config -g cache-dir "$(pwd)/.cache"
script:
- php -d memory_limit=2G composer.phar install --optimize-autoloader --no-ansi --no-interaction --no-progress
cache:
paths:
- .cache/
artifacts:
expire_in: 30 min
paths:
- bin
- tests/app/vendor/
code_style:
stage: Tests
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
script:
- bin/grumphp run --tasks=phpcsfixer
artifacts:
expire_in: 30 min
paths:
- bin
- tests/app/vendor/
phpstan_tests:
stage: Tests
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
script:
- bin/grumphp run --tasks=phpstan
artifacts:
expire_in: 30 min
paths:
- bin
- tests/app/vendor/
psalm_tests:
stage: Tests
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
script:
- bin/grumphp run --tasks=psalm
allow_failure: true
artifacts:
expire_in: 30 min
paths:
- bin
- tests/app/vendor/
unit_tests:
stage: Tests
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
script:
- php tests/app/bin/console doctrine:migrations:migrate -n
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
- php -d memory_limit=3G tests/app/bin/console doctrine:fixtures:load -n
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=test
- php -d memory_limit=4G bin/phpunit --colors=never
artifacts:
expire_in: 30 min
paths:
- bin
- tests/app/vendor/
@@ -0,0 +1,24 @@
# Description of changes
<!--
describe here the change of your MR. It can be either a text, or a bullet list
for changes
-->
# Issues related
<!--
list the issues related to this MR.
It may be client issues, or dev issues
-->
* ...
* ...
# Tests
<!-- Describe tests if any, or why no tests -->
+79
View File
@@ -0,0 +1,79 @@
<?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);
/** @var \drupol\PhpCsFixerConfigsPhp\Config\Php73 $config */
$config = require __DIR__ . '/tests/app/vendor/drupol/php-conventions/config/php73/php_cs_fixer.config.php';
$config
->getFinder()
->ignoreDotFiles(false)
->notPath('tests/app')
->name(['.php_cs.dist.php']);
$rules = $config->getRules();
$riskyRules = [
'ternary_to_elvis_operator' => false,
'php_unit_mock_short_will_return' => false,
'php_unit_set_up_tear_down_visibility' => false,
'php_unit_construct' => false,
'php_unit_dedicate_assert' => false,
'php_unit_expectation' => false,
'php_unit_mock' => false,
'php_unit_namespaced' => false,
'php_unit_no_expectation_annotation' => false,
'php_unit_test_case_static_method_calls' => false,
'php_unit_test_annotation' => false,
// 'final_internal_class' => false,
// 'strict_param' => false,
// 'declare_strict_types' => false,
// 'strict_comparison' => false,
// 'no_unreachable_default_argument_value' => false,
// 'ereg_to_preg' => false,
// 'ordered_interfaces' => false,
// 'error_suppression' => false,
// 'non_printable_character' => false,
// 'ordered_traits' => false,
// 'no_useless_sprintf' => false,
// 'dir_constant' => false,
// 'no_alias_functions' => false,
// 'implode_call' => false,
// 'combine_nested_dirname' => false,
// 'pow_to_exponentiation' => false,
// 'comment_to_phpdoc' => false,
// 'no_unset_on_property' => false,
// 'native_constant_invocation' => false,
// 'function_to_constant' => false,
// 'is_null' => false,
// 'native_function_invocation' => false,
// 'no_trailing_whitespace_in_string' => false,
// 'array_push' => false,
// 'fopen_flag_order' => false,
// 'fopen_flags' => false,
// 'logical_operators' => false,
// 'modernize_types_casting' => false,
// 'no_homoglyph_names' => false,
// 'no_unneeded_final_method' => false,
// 'random_api_migration' => false,
// 'static_lambda' => false,
// 'set_type_to_cast' => false,
// 'string_line_ending' => false,
// 'psr_autoloading' => false,
];
$rules = array_merge(
$rules,
$riskyRules
);
$rules['header_comment']['header'] = trim(file_get_contents(__DIR__ . '/resource/header.txt'));
return $config->setRules($rules);
+561
View File
@@ -0,0 +1,561 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
* [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for stable releases;
* date versioning for test releases
## Unreleased
<!-- write down unreleased development here -->
* [person] Accompanying course evaluation documents: disable the WOPI edit link if mimetype not supported and if no keyInfos
(https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/585)
* [activity] display error messages above the form in creating a new location (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/481)
* [activity] show required field in activity edit/new by an asterix in the vuejs fields (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/494)
* [ACL] fix allow to see the course, event if the scope'course does not contains the scope's user
* [search] enforce limit of results for fetching rsults by search api https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/576
* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554)
* [activity] Add return path the document generation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/553)
* [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517)
* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546)
* [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512)
* [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511)
* [person] AccompanyingPeriodWork: add referrers to work, add doctrine event listener to add logged user to referrers collection and display a referrers list in work list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/502)
* [person] AccompanyingPeriodWorkEvaluation: fix circular reference when serialising (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/495)
* [person] order accompanying period by opening date in search persons, person and household period lists (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/493)
* [parcours] autosave of the pinned comment for draft accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/477)
* [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472)
* [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)
* [budget]: budget enabled for persons and households (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/469)
* [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)
* [household] bugfix if position of member is null, renderbox no longer throws an error (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/480)
* [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)
* [address] person badge in address history changed to open OnTheFly with all person info (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/489)
* [person] Change 'personne' with 'usager' and '&' with 'ET' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/499)
* [thirdparty] Add parameter condition to display centers or not (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/500)
* [phonenumber] Remove placeholder in phonenumber field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/496)
* [person_resource] separate create page created to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/504)
* [contact] add contact button color changed plus the pipe at the side removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/506)
* [thirdparty] For contacts show current civility/profession in edit form + fix saving of edited information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/491)
* [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505)
* [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486)
* [thirdparty] add firstname field to thirdparty 'child' or 'contact' types (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/508)
* [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505)
* [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486)
* [parcours] List of parcours for a specific user so they can be reassigned in case of absence (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/509)
* [thirdparty] Thirdparty view page, english text translated (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/534)
* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512)
* [filiation] Possible to add person (or create onthefly) to add to filiation graph + add relation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/519)
* [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560)
* [person_resource] bugfix when adding thirdparty or freetext resource + prevent personOwner themselves to be added. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/526)
* [aside_activity] style correction + sticky-form create button (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/529)
* [budget] order within the menu adjusted (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/592)
* [onthefly] fix create person. Bug was noticed in filiation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/591)
* [parcours] Create document buttons made sticky (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/532)
* [person] Trailing guillemet removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/530)
* [notification] Display of social action within workflow notification set to display block (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/537)
* [onthefly] trim trailing whitespace in email of person and thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/542)
* [person] fix bug when phonenumber or mobile number is left empty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546)
## 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)
* [doc-generator] do not set required fields for mainPerson, person1, person2 (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement#456)
* [doc-generation] add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/370)
* [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
* [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)
* [homepage_widget]: fix translation on emergency badge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/440)
* [person]: create person and household added to button dropdown (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/454)
* display full address in address.text in normalization. Adapt AddressRenderBox
* [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)
### test release 2021-02-01
* renommer "dossier numéro" en "parcours numéro" dans les résultats de recherche
* renomme date de début en date d'ouverture dans le formulaire parcours
* [homepage widget] improve content tables, improve counter pluralization with style on number
* [notification lists] add comments counter information
* [workflows] fix popover header with previous transition
* [parcours]: validation + message for closing parcours adjusted.
* [household]: household composition double edit button replaced by a delete action (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/426)
[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.
* [person]: Comment on marital status is possible even if marital status is not defined (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/421)
* [parcours]: In the list of person results the requestor is not displayed if defined as anonymous (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/424)
* [bugfix]: modal closes and newly created person/thirdparty is selected when multiple persons/thirdparties are created through the modal (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/429)
* [person_resource]: Onthefly button added to view person/thirdparty and badge differentiation for a contact-thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/428)
* [workflow][notification] improve how notifications and workflows are 'attached' to entities: contextual list, counter, buttons and vue modal
* [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)
* [person] accompanying course: close modal when edit participation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/420)
* [person] accompanying course: treat validation error when editing on-the-fly entities (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/420)
* [activity] show activity attendee (présence) in the activity list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/412)
* [activity] admin: change validation rule for social action visible field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/413)
* [parcours]: component added to change the opening date of a parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/411)
* [search]: listing of parcours display changed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/410)
* [user]: page with accompanying periods to which is user is referent (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/408)
* [person] age added to renderstring + renderbox/ vue component created to display person text (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/389)
* [household member editor] allow to push to existing household
### test release 2021-01-28
* [person] improve filiations vis graph: disable physics, use chill colors for persons-households-course, increase label of relations, remove labels on household arrows and other improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/286, https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/362)
* [activity] Order activity by date and by id (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/364)
* [main] increase length of 4 Address fields (change to TEXT, no size limits) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/277)
* [main] Add confidential option for address, in edit and view (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/165)
* [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377)
* [person] Add residential address entity, form and list for each person
* [aside_activity]: dynamicUserPickerType used (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/399)
* dispatching list
### test release 2021-01-26
* [parcours] comments truncated if too long + link added (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/406)
* [person]: possibility to add person resources (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/382)
* [person ressources]: module added
### test release 2022-01-24
* [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377)
* [notification: formulaire création] descend la box avec la description dans le bas du formulaire
* [notification for activity]: fix link to activity
* [notification] add "URGENT" before accompanying course with emergency = true
* [notification] add a "read more" button on system notification
* [notification] add `[Chill]` in the subject of each notification, automatically
* [notification] add a counter for notification in activity list and accompanying period list, and search results
* [parcours] bugfix if deathdate is not defined (eg. for a thirdparty) parcours is still displayed. Gave error before.
* [workflow] add breadcrumb to show steps
* [popover] add popover html popup mechanism (used by workflow breadcrumb)
* [templates] improve updatedBy macro in item metadatas
* [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385)
* [workflow]
* add My workflow section with my opened subscriptions
* apply workflow on documents, accompanyingCourseWork and Evaluations
* [wopi-link] a new vue component allow to open wopi link in a fullscreen chill-themed modal
### test release 2022-01-19
* vuejs: add dead information on all on-the-fly person render boxes, in vis graph and other templates (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/271)
* [thirdparty] fix bug in 3rd party view: types was replaced by thirdPartyTypes
* [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246)
* [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176)
* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380)
* [forms] dynamic picker types for user/person/thirdparty types created (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/386)
### test release 2022-01-17
* [main] Add editableByUser field to locationType entity, adapt the admin template and add this condition in the location-type endpoint (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/297)
* [main] Add mainLocation field to User entity and add it in user form type
* rewrite page which allow to select activity
* [main] Add mainLocation field to User entity and add it in user form type
* [course list in person context] show full username/label for ref
* [accompanying period work] remove the possibility to generate document from an accompanying period work
* vuejs: add validation on required fields for AddPerson, Address and Location components
* vuejs: treat 422 validation errors in locations and AddPerson components
* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380)
## Test releases
* vuejs: add validation on required fields for AddPerson, Address and Location components
* vuejs: treat 422 validation errors in locations and AddPerson components
* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380)
### test release 2022-01-12
* fix thirdparty normalizer on telephone field: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/322
### test release 2022-01-11
* vuejs: translate in French all multiselect widgets
* [address] define address lines according postal standards for France and Belgium (default) and change AddressRender, chill_entity_render_box and AddressRenderBox.vue
* [household] change translations (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
* [household] add address i18n in household component (champs-libres/departement-de-la-vendee/accent-suivi-developpement#158)
* [household] add on the fly i18n in household component
* [household] redirect to the household page when a household is created from a person (champs-libres/departement-de-la-vendee/accent-suivi-developpement#175)
* [household] household member editor: display alert if some members have already an household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#172)
* [household] household member editor: do not add in new members if the member is included in the members of household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#123)
* [household] household member editor: remove markNoAddress button (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
* [person]: ordering fields in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
* [person]: Add email and alt names in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
* [accompanyingCourse] Add a delete action and delete buttons to delete a accompanying course when step = DRAFT (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/64)
* [accompanyingCourse] Add a administrative location in the accompanying course, set the user current location as default, allow to select a location in a select field and do not allow to confirm the accompanying course if location is empty.
* [accompanyingCourse] Add the administrative location in the available variables for document generation
* AddAddress: optimize loading: wait for the user finish typing;
* UserPicker: fix bug with deprecated role
* docgen: add base context + tests
* docgen: add age for person
* [household menu] fix filiation order https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/265
* [AddAddress]: optimize loading: wait for the user finish typing;
* [UserPicker]: fix bug with deprecated role
* [docgen]: add base context + tests
* [docgen]: add age for person
* [task]: fix dropdown menu style + fix bug in singleTaskController (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/338)
* Household: fix bug when moving person on the same day (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/281)
* Household: show date validFrom and validTo when moving
* address reference: add index for refid
* [accompanyingCourse_work] fix styles conflicts + fix bug with remove goal (remove goals one at a time)
* [accompanyingCourse] improve masonry on resume page, add origin
* [notification] new notification interface, can be associated to AccompanyingCourse/Period, Activities.
* List notifications, show, and comment in User section
* Notify button and contextual notification box on associated objects pages
* [accompanyingCourse] add a comment for each resource associated. A modal allow to save comment. Comment is displayed in on-the-fly show modal of the accompanyingCourse context (edit page + resume page).
### test release 2021-12-14
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
* [main] add availableForUsers condition from locationType in the location API endpoint (champs-libres/departement-de-la-vendee/accent-suivi-developpement#248)
* [main] add the current location of the user as API point + add it in the activity location list (champs-libres/departement-de-la-vendee/accent-suivi-developpement#247)
* [activity] improve show/new/edit templates, fix SEE and SEE_DETAILS acl
* [badges] create specific badge for TMS, and make person/thirdparty badges clickable with on-the-fly modal in :
* concerned groups items (activity, calendar)
* accompanyingCourseWork lists
* accompanyingCourse lists
* [acompanyingCourse] add initial comment on Resume page
* [person] create button full width (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/330)
### test release 2021-12-11
* [main] add order field to civility
* [main] change address format in case the country is France, in Address render box and address normalizer
* [person] add validator for accompanying period with a test on social issues (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/76)
* [activity] fix visibility for location
* [origin] fix origin: use correctly the translatable strings
* /!\ everyone must update the origin table. As there is only one row, execute `update chill_person_accompanying_period_origin set label = jsonb_build_object('fr', 'appel téléphonique');`
* [person] redirect bug fixed.
* [action] add an unrelated issue within action creation.
* [origin] fix origin: use correctly the translatable strings
* /!\ everyone must update the origin table. As there is only one row, execute `update chill_person_accompanying_period_origin set label = jsonb_build_object('fr', 'appel téléphonique');`
* [main] change order of civilities in civility fixtures (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
* [person] set min attr in the minimum of children field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
* [person] add marital status date in person view (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
* [person] show number of children + allow set number of children to null (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
* [person] show acceptSMS option (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
* [person] add death information in person render box in twig and vue render boxes (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
* [accompanyingcourse_work] Changes in layout/behavior of edit form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/321)
* [badge-entity] design coherency between pills badge-person and 3 kinds of badge-thirdparty
* [AddPersons] suggestions row are clickable, not only checkbox
### test release 2021-12-06
* [main] address: use search API end points for getting postal code and reference address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/316)
* [main] address: in edit mode, select the encoded values in multiselect for address reference and city (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/316)
* [person search] fix bug when using birthdate after and birthdate before
* [person search] increase pertinence when lastname begins with search pattern
* [activity/actions] Améliore la cohérence du design entre
* la page résumé d'un parcours (liste d'actions récentes et liste d'activités récentes)
* la page liste des actions
* la page liste des activités (contexte personne / contexte parcours)
* [household] field to edit wheter person is titulaire of household or not removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/322)
* [activity] create work if a work with same social action is not associated to the activity
* [visgraph] improve and fix bugs on vis-network relationship graph
* [bugfix] posting of birth- and deathdate through api fixed.
* [suggestions] improve suggestions lists
### Test release 2021-11-19 - bis
* [household] do not allow to create two addresses on the same date
* [activity] handle case when there is no social action associated to social issue
* [activity] layout for issues / actions
* [activity][bugfix] in edit mode, the form will now load the social action list
### Test release 2021-11-29
* [person] suggest entities (person | thirdparty) when creating/editing the accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/119)
* [activity] add custom validation on the Activity class, based on what is required from the ActivityType (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/188)
* [main] translate multiselect messages when selecting/creating address
* [main] set the coordinates of the city when creating a new address OR choosing "pas d'adresse complète"
* Use the user.label in accompanying course banner, instead of username;
* fix: show validation message when closing accompanying course;
* [thirdparty] link from modal to thirdparty detail page fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/228)
* [assets] new asset to style suggestions lists (with add/remove item link) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/258)
* [accompanyingCourseWorkEdit] improves hyphenation and line breaks for long badges
* [acompanyingCourse] improve Resume page
* complete all needed informations,
* actions and activities are clickables,
* better placement with js masonry blocks on top of content area,
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/101
* https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/295
* [activity/calendar] on show page, concerned groups of persons table adapt itself to isVisibles options
* [activity] remove the "plus" button in activity list
* [activity] check ACL on activity list in person context
* [list for accompanying course in person] filter list using ACL
* [validation] toasts are displayed for errors when modifying accompanying course (generalization required).
* [period] only the user can enable confidentiality
* 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
### Test release 2021-11-22
* [activity] delete admin_user_show in twig template because this route is not defined and should be defined
* [activity] suggest requestor, user and ressources for adding persons|user|3rdparty
* [calendar] suggest persons, professionals and invites for adding persons|3rdparty|user
* [activity] take into account the restrictions on person|thirdparties|users visibilities defined in ActivityType
* [main] Add currentLocation to the User entity + add a page for selecting this location + add in the user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/133)
* [activity] add user current location as default location for a new activity (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/133)
* [task] Select2 field in task form to allow search for a user (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/167)
* remove "search by phone configuration option": search by phone is now executed by default
* remplacer le classement par ordre alphabétique par un classement par ordre de pertinence, qui tient compte:
* de la présence d'une string avec le nom de la ville;
* de la similarité;
* du fait que la recherche commence par une partie du mot recherché
* ajouter la recherche par numéro de téléphone directement dans la barre de recherche et dans le formulaire recherche avancée;
* ajouter la recherche par date de naissance directement dans la barre de recherche;
* ajouter la recherche par ville dans la recherche avancée
* ajouter un lien vers le ménage dans les résultats de recherche
* ajouter l'id du parcours dans les résultats de recherche
* ajouter le demandeur dans les résultats de recherche
* ajout d'un bouton "recherche avancée" sur la page d'accueil
* [person] create an accompanying course: add client-side validation if no origin (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/210)
* [person] fix bounds for computing current person address: the new address appears immediatly
* [docgen] create a normalizer and serializer for normalization on doc format
* [person normalization] the key center is now "centers" and is an array. Empty array if no center
* [accompanyingCourse] Ability to close accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/296)
* [task] Select2 field in task form to allow search for a user (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/167)
* [list result] show all courses, except ones with period closed
* [accompanyingCourse] improve banner with small carousel to display slide social-issues or slide associated persons (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/69)
### Test release 2021-11-15
* [main] fix adding multiple AddresseDeRelais (combine PickAddressType with ChillCollection)
* [person]: do not suggest the current household of the person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/51)
* [person]: display other phone numbers in view + add message in case no others phone numbers (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/184)
* unnecessary whitespace removed from person banner after person-id + double parentheses removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/290)
* [person]: delete accompanying period work, including related objects (cascade) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/36)
* [address]: Display of incomplete address adjusted.
* [household]: improve relationship graph
* add form to create/edit/delete relationship link,
* improve graph refresh mechanism
* add feature to export canvas as image (png)
* [person suggest] In widget "add person", improve the pertinence of persons when one of the names starts with the pattern;
* [person] do not ask for center any more on person creation
* [3party] do not ask for center any more on 3party creation
## Test releases
### Test release 2021-11-08
* [person]: Display the name of a user when searching after a User (TMS)
* [person]: Add civility to the person
* [person]: Various improvements on the edit person form
* [person]: Set available_languages and available_countries as parameters for use in the edit person form
* [activity] Bugfix: documents can now be added to an activity.
* [tasks] improve tasks with filter order
* [tasks] refactor singleControllerTasks: limit the number of conditions from the context
* [validations] validation of accompanying period added: no duplicate participations or resources (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/60).
* [renderbox] If gender of person is not defined, no icon is displayed instead of neuter-icon (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/129).
* [confidential information] module added to blur confidential information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/248).
* refactor `AuthorizationHelper` and `UserACLAwareRepository` to fix constructor, and separate logic for parent role helper into `ParentRoleHelper`
* [main]: filter location and locationType in backend: exclude NULL names, only active and availableToUsers
* [activity]: perform client-side validation & show/hide fields in the "new location" modal
* [person]: normalize person with CenterResolverDispatcher and handle case where center is null or multiple in PersonRenderBox
* [docstore] voter for PersonDocument and AccompanyingCourseDocument on the 2.0 way (using VoterHelperFactory)
* [docstore] add authorization check inside controller and menu
* [activity]: fix inheritance for role `ACTIVITY FULL` and add missing acl in menu
* [person] show current address in search results
* [person] show alt names in search results
* [admin]: links to activity admin section added again.
* [household]: endDate field deleted from household edit form.
* [household]: View accompanying periods of current and old household members.
* [tasks]: different layout for task list / my tasks, and fix link to tasks in alert or in warning
* [admin]: links to activity admin section added again.
* [household]: household addresses ordered by ValidFrom date and by id to show the last created address on top.
* [socialWorkAction]: display of social issue and parent issues + banner context added.
* [DBAL dependencies] Upgrade to DBAL 3.1
### Test release 2021-10-27
* [person]: delete double actions buttons on search person page
* [person]: accompanying course work: remove creation date display the list of work + handle case when end date is null
* [main]: Add new pages with a menu for managing location and location type in the admin
* [main]: Add some fixtures for location type
* [calendar]: Pass the location when transforming a calendar item (rdv) into an activity
* [calendar]: Add a user menu for "my calendar"
### Test release 2021-10-18
* [3party]: french translation of contact and company
* [3party]: show parent in list
* [3party]: change color for badge "child"
* [3party]: fix address creation
* [household members editor] finalisation of editor
* [AccompanyingCourse banner]: replace translation referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/70)
* [Location]: add location system in activity and RV (calendar). User can choose in location list or create a new location.
* [household]: add relationship page with dynamic data visualisation graph
## Test releases
### Test release 2021-10-11
* Address: zoom on postal code geometry + fix origin of manually entered postal code
* in the Address vue component, order the postal code and street address by alphabetic and numeric order
* add 3 new fields to PostalCode and adapt postal code command and fixtures
* [Aside activity] Fixes for aside activity
* categories with child
* fast creation buttons
* add ordering for types
* [AccompanyingCourse Resume page] dashboard for AccompanyingCourseWork and for Activities;
* Improve badges behaviour with small screens;
* [ThirdParty]:
* third party list
* create a kind contact/institution when create a new thirdparty, and set contact embedded as kind=child;
* filter thirdparties in list
* [FilterOrder]: add development kit for generating filter and ordering in list
* [Capitalization of names] person names are capitalized on creation, on prePersist event
* [On-The-Fly] modale works for showing, editing and creating person or thirdparty ;
* [AccompanyingCourse Resume page] associated persons list, can see household when hover, and with show on-the-fly modale when clicking person ;
### test release 2021-10-04
* [Household editor][UI] Update how household suggestion and addresses are picked;
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/80
* [AddAddress] Handle address suggestion;
* [CenterType][Create a person] when overriding the ACL rules, allow to show a PickCenterType
when no centers are reachable by the default ACL.
* [Household] Show comment event if no address are associated with the household;
* [Person results] Add requestor into search results:
* a badge "requestor" is shown into search results;
* periods where the person is only requestor (without participating) are also shown;
Issues:
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/13
* https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/199
* [Person form] "accept sms" not required:
https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/37
https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/221
* [Household editor] suggest only temporarily addresses;
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/82
* On-The-Fly modale works for showing, editing and creating person and thirdparty ;
* AccompanyingCourse Resume page: list associated persons by household, see household when hover, and show on-the-fly modale when clicking on person ;
* [AddAddress] Handle address suggestion;
* [AddAddress][Entity address]: add a link between address and address reference;
* [Household editor] suggest household by comparing the temporary addresses from courses;
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/81
* On-The-Fly modale works for showing, editing and creating person and thirdparty
## Test released
<!--
Coming soon...
DO NOT ADD unreleased items here. Add them under "Unreleased" title
### Test release yyyy-mm-dd
-->
## Stable releases
No stable releases for v2+
+411
View File
@@ -0,0 +1,411 @@
# Conventions Chill
en cours de rédaction
## Assets: nommage des entrypoints
Trois types d'entrypoint:
* application vue (souvent spécifique à une page) -> préfixé par `vue_`;
* code js/css qui est réutilisé à plusieurs endroits:
* ckeditor
* async_upload (utilisé pour un formulaire)
* bootstrap
* chill.js
* ...
=> on préfixe `mod_`
* code css ou js pour une seule page
* ré-utilise parfois des "foncitionnalités": ShowHide, ...
=> on préfixe `page_`
Arborescence:
```
# Sous Resources/public
- chill/ => theme (chill)
- chillmain.scss -> push dans l'entrypoint chill
- lib/ => ne vont jamais dans un entrypoint, mais sont ré-utilisés par d'autres
- ShowHide
- Collection
- Select2
- module/ => termine dans des entrypoints ré-utilisables (mod_)
- bootstrap
- custom.scss
- custom/
- variables.scss
- ..
- forkawesome
- AsyncUpload
- vue/ => uniquement application vue (vue_)
- _components
- app
- page/ => uniquement pour une seule page (page_)
- login
- person
- personvendee
- household_edit_metadata
- index.js
```
## Organisation des feuilles de styles
Comment s'échaffaudent les styles dans Chill ?
1. l'entrypoint **mod_bootstrap** (module bootstrap) est le premier niveau. Toutes les parties(modules) de bootstrap sont convoquées dans le fichier ```bootstrap.js``` situé dans ```ChillMainBundle/Resources/public/module/bootstrap```.
* Au début, ce fichier importe le fichier ```variables.scss``` qui détermine la plupart des réglages bootstrap tels qu'on les a personnalisés. Ce fichier surcharge l'original, et de nombreuses variables y sont adaptées pour Chill.
* On veillera à ce qu'on puisse toujours comparer ce fichier à l'original de bootstrap. En cas de mise à jour de bootstrap, il faudra générer un diff, et adapter ce diff sur le fichier variable de la nouvelle version.
* A la fin on importe le fichier ```custom.scss```, qui comprends des adaptations de bootstrap pour le préparer à notre thème Chill.
* ce ```custom.scss``` peut être splitté en plus petits fichiers avec des ```@import 'custom/...'```
* L'idée est que cette première couche bootstrap règle un partie importante des styles de l'application, en particulier ce qui touche aux position du layout, aux points de bascules responsive, aux marges et écarts appliqués par défauts aux éléments qu'on manipule.
2. l'entrypoint **chill** est le second niveau. Il contient le thème Chill qui est reconnaissable à l'application.
* Chaque bundle a un dossier ```Resources/public/chill``` dans lequel on peut trouver une feuille sass principale, qui est éventuellement splittée avec des ```@imports```. Toutes ces feuilles sont compilées dans un unique entrypoint Chill, c'est le thème de l'application. Celui-ci surcharge bootstrap.
* La feuille chillmain.scss devrait contenir les cascades de styles les plus générales, celles qui sont appliquées à de nombreux endroits de l'application.
* La feuille chillperson.scss va aussi retrouver des styles propres aux différents contextes des personnes: person, household et accompanyingcourse.
* Certains bundles plus secondaires ne contiennent que des styles spécifiques à leur fonctionnement.
3. les entrypoints **vue_** sont utilisés pour des composants vue. Les fichiers vue peuvent contenir un bloc de styles scss. Ce sont des styles qui ne concernent que le composant et son héritage, le tag ```scoped``` précise justement sa portée (voir la doc).
4. les entrypoints **page_** sont utilisés pour ajouter des assets spécifiques à certaines pages, le plus souvent des scripts et des styles.
## Taguer du code html et construire la cascade de styles
L'exemple suivant montre comment taguer sans excès un élément de code. On remarque que:
* il n'est pas nécessaire de taguer toutes les classes intérieures,
* il ne faut pas répéter la classe parent dans toutes les classes enfants. La cascade sass va permettre de saisir le html avec souplesse sans alourdir la structure des balises.
* souvent la première classe sera déclinée par plusieurs classes qui commencent de la même manière: ```bloc-dark``` ajoute juste la version sombre de ```bloc```, on ne met pas ```bloc dark```, car on ne souhaite pas que la classe ```dark``` de ```bloc``` interagisse avec la même classe ```dark``` de ```table```. On aura donc un élément ```bloc bloc-dark``` et un élément ```table table-dark```.
```html
<div class="bloc bloc-dark mon-bloc">
<h3>mon titre</h3>
<ul class="record_actions">
<li>
<a class="btn btn-edit"></a>
</li>
<li></li>
<li></li>
</ul>
</div>
```
Finalement, il importe ici de définir ce qu'est un bloc, ce qu'est une zone d'actions et ce qu'est un bouton. Ces 3 éléments existent de manière autonome, ce sont les seuls qu'on tagge.
Par exemple pour mettre un style au titre on précise juste h3 dans la cascade bloc.
```scss
div.bloc {
// un bloc générique, utilisé à plusieurs endroits
&.bloc-dark {
// la version sombre du bloc
}
h3 {}
ul {
// une liste standard dans bloc
li {
// des items de liste standard dans bloc
}
}
}
div.mon-bloc {
// des exceptions spécifiques à mon-bloc,
// qui sont des adaptations de bloc
}
ul.record_actions {
// va uniformiser tous les record_actions de l'application
li {
//...
}
}
.btn {
// les boutons de bootstrap
.btn-edit {
// chill étends les boutons bootstrap pour ses propres besoins
}
}
</style>
```
## Render box
## URL
### Nommage des routes
:::warning
Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhaitées pour le futur.
:::
Les routes sont nommées de cette manière:
`chill_bundle_entite_action`
1. d'abord chill_ (pour tous les modules chill)
2. ensuite une string qui est identique, par bundle
3. si le point est un point d'api (json), alors ajouter la string `api`
4. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités
5. ensuite une action (`list`, `view`, `edit`, `new`, ...)
Le fait d'indiquer `api` en 3 permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`)
Si les points 4 et 5 sont inexistants, alors ils sont remplacés par d'autres éléments de manière à garantir l'unicité de la route, et sa bonne compréhension.
### URL
Les URL respectent également une convention:
#### Pour les pages html
:::warning
Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhaitées pour le futur.
:::
Syntaxe:
```
/{_locale}/bundle/entity/{id}/action
/{_locale}/bundle/entity/sub-entity/{id}/action
```
Les éléments suivants devraient se trouver dans la liste:
1. la locale;
2. un identifiant du bundle
3. l'entité auquel il se rapporte
4. les éventuelles sous-entités auxquelles l'url se rapport
5. l'action
Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte.
Exemple:
```
# liste des échanges pour une personne
/fr/activity/person/25/activity/list
# nouvelle activité
/fr/activity/activity/new?person_id=25
```
#### Pour les API
:::info
Les routes générées automatiquement sont préfixées par chill_api
:::
Syntaxe:
```
/api/1.0/bundle/entity/{id}/action
/api/1.0/bundle/entity/sub-entity/{id}/action
```
Les éléments suivants devraient se trouver dans la liste:
1. la string `/api/` et puis la version (1.0)
2. un identifiant du bundle
3. l'entité auquel il se rapporte
4. les éventuelles sous-entités auxquelles l'url se rapport
5. l'action
Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte.
## Règles UI chill
### Titre des pages
#### Chaque page contient un titre
Chaque page contient un titre dans la balise head. Ce titre est normalement identique à celui de l'entête de la page.
Astuce: il est possible d'utiliser la fonction `block` de twig pour cela:
```htmlmixed=
{% block title "Titre de la page" %}
{% block content %}
<h1>
{{ block('title')}}
</h1>
{% endblock %}
```
### Utilisation des `entity_render`
#### En twig
Les templates twig doivent toujours utiliser la fonction chill_entity_render_box pour effectuer le rendu des éléments suivants:
* User
* Person
* SocialIssue
* SocialAction
* Address
* ThirdParty
* ...
Exemple:
```
address|chill_entity_render_box
```
Justification:
* des éléments sont parfois personnalisés par installation (par exemple, le nom de chaque utilisateur sera suivi par le nom du service)
* pour rationaliser et rendre semblable les affichages
* pour simplifier le code twig
A prevoir:
* toujours trois positions:
* inline
* block
* item (dans un tableau, une ligne)
> block et item sont en fait la même option passée au render_box: render: bloc. Il y a aussi raw pour le inline, et label pour une titraille configurable avec des options.
> quand on passe loption render: bloc, on peut placer le render_box dans une boucle for plus large qui fonctionne avec la classe flex-table ou la classe flex-bloc, ce qui donnera un affichage en rangée (table) ou en blocs. [name=Mathieu]
#### En vue
Il existe systématiquement une "box" équivalente en vue.
#### Lien vers des sections
A chaque fois qu'on indique le nom d'une personne, un parcours, un ménage, il y a toujours:
* un lien pour accéder à son dossier (pour autant que l'utilisateur ait les droits d'accès);
* à moins qu'il ne soit indiqué dans une phrase, l'icône de son dossier avant ou après (donc un bonhomme pour la personne, une maison pour le ménage, un fa-random pour les parcours);
Ces éléments sont toujours proposé par des `render_box` par défaut. Des options permettent de les désactiver dans des cas particuliers
> à discuter, quelques réflexion:
> quelle est la logique qui domine pour les boutons ? on a symbolisé les 4 actions du crud par des couleurs: bleu(show) orange(edit) vert(create) et rouge(delete).
> Est-ce que c'est ça qui prime, et comment ça s'articule avec la logique des pictos ?
> Par exemple, il pourrait être logique d'utiliser l'oeil bleu pour voir l'objet, qu'il s'agisse d'une personne ou d'un parcours, ce serait plutôt le contexte, et l'infobulle (title) qui préciserait le contexte.
> Je pense que les pictos de boutons doivent faire référence à l'action, mais pas à l'objet. Autrement dit je n'utiliserais jamais l'icone du ménage ou du parcours dans les boutons.
> Pour représenter les ménages et les parcours, je pense qu'il faudrait trouver autre chose que forkawesome. Si c'est des pictos, trouver un motif différents et de tailles différente. Réfléchir à un couplage picto-couleur-forme différent, qui exprime le contexte et qui se distingue bien des boutons.
> Idem pour les badges, il faut une palette de badge qui couvre tous les besoins: socialIssue, socialActions, socialReason, members, etc. [name=Mathieu]
### Formulaires
#### Vocabulaire:
Utiliser toujours:
* `Créer` dans un `bt bt-create` pour les **liens** vers le formulairep pour créer une entité (pour parvenir au formulaire);
* `Enregistrer` dans un `bt bt-save` pour les boutons "Enregistrer" (dans un formulaire édition **ou** création);
* `Enregistrer et nouveau`
* `Enregistrer et voir`
* `Modifier` dans un `bt bt-edit` pour les **liens** vers le formulaire d'édition
* `Dupliquer` (préciser là où on peut le voir)
* `Annuler` pour quitter une page d'édition avec un lien vers la liste, ou le `returnPath`
#### Retour après un enregistrement
Après avoir cliqué sur "Créer" ou "Sauver", la page devrait revenir:
* vers le returnPath, s'il existe;
* sinon, vers la page "vue".
### Bandeaux contenant les boutons d'actions
Les boutons sont toujours dans un bandeau "sticky-form" dans le bas du formulaire ou de la page de liste.
Si pertinent:
* Le bandeau contient un bouton "Annuler" qui retourne à la page précédente. Il est obligatoire pour les formulaires, optionnel pour les listes ou les pages "résumés"
* Ce bouton "annuler" est toujours à gauche
```
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ chill_entity_return_path('route_name' { 'route': 'option' } )}}">{{ return_path_label }}</a>
</li>
<li>
<!-- action 1 -->
</li>
</ul>
```
### Messages flash
#### A la création d'une entité
A chaque fois qu'un élément est créé par un formulaire, un message flash doit apparaitre. Il indique:
> "L'élément a été créé"
Le nom de l'élément peut être remplacé par quelque chose de plus pertinent:
> * L'activité a été créée
> * Le rendez-vous a été créé
> * ...
#### A l'enregistrement d'une entité
A chaque fois qu'un élément est enregistré, un message flash doit apparaitre:
> * Les données ont été modifiées
>
#### Erreur sur un formulaire (erreur de validation)
En tête d'un formulaire, un message flash doit indiquer que des validations n'ont pas réussi:
> Ce formulaire contient des erreurs
Les erreurs doivent apparaitre attachée au champ qui les concerne. Toutefois, il est acceptable d'afficher les erreurs à la racine du formulaire s'il était complexe, techniquement, d'attacher les erreurs.
### Liens de retour
A chaque fois qu'un lien est indiqué, vérifier si on ne doit pas utiliser la fonction `chill_return_path`, `chill_forward_return_path` ou `chill_return_path_or`.
* depuis la page liste, vers l'ouverture d'un élément, ou le bouton création => utiliser `chill_path_add_return_path`
* dans ces pages d'éditions,
* utiliser `chill_return_path_or` dans le bouton "Cancel";
* pour les boutons "enregistrer et voir" et "Enregistrer et fermer" => ?
### Assets pour les listes de suggestion
Créer une liste de suggestions à ajouter (tout l'item est cliquable)
```html
<ul class="list-suggest add-items">
<li>
<span>item</span>
</li>
</ul>
```
Créer une liste de suggestions à enlever (avec une croix rouge cliquable, l'ancre a est vide)
```html
<ul class="list-suggest remove-items">
<li>
<span>
item
</span>
</li>
</ul>
```
Créer un titre enlevable (avec une croix rouge cliquable, l'ancre a est vide)
```html
<div class="item-title">
<span>title</span>
</div>
```
Les classes `cols` ou `inline` peuvent être ajoutées à côté de `list-suggest` pour modifier la disposition de la liste.
Dans le dernier exemple, on met une classe `removable` sur le span, si on veut pouvoir enlever l'élément.
+4 -4
View File
@@ -629,12 +629,12 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
chill-bundles
Copyright (C) 2021 Chill Project
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
Executable
BIN
View File
Binary file not shown.
+65 -46
View File
@@ -1,75 +1,85 @@
{
"name": "chill-project/chill-bundles",
"type": "library",
"description": "Most used bundles for chill-project",
"license": "AGPL-3.0-only",
"type": "library",
"keywords": [
"chill",
"social worker"
],
"license": "AGPL-3.0-only",
"require": {
"champs-libres/async-uploader-bundle": "dev-sf4",
"champs-libres/wopi-bundle": "dev-master",
"composer/package-versions-deprecated": "^1.10",
"php": "^7.4",
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
"champs-libres/wopi-bundle": "dev-master#59b468503b9413f8d588ef9e626e7675560db3d8",
"champs-libres/wopi-lib": "dev-master#0e1da19bb6de820080b8651867a7e475be590060",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.7",
"erusev/parsedown": "^1.7",
"graylog2/gelf-php": "^1.5",
"knplabs/knp-menu": "^3.1",
"knplabs/knp-menu-bundle": "^3.0",
"knplabs/knp-time-bundle": "^1.12",
"league/csv": "^9.7.1",
"nyholm/psr7": "^1.4",
"ocramius/package-versions": "^1.10",
"odolbeau/phone-number-bundle": "^3.6",
"phpoffice/phpspreadsheet": "^1.16",
"ramsey/uuid-doctrine": "^1.7",
"sensio/framework-extra-bundle": "^5.5",
"symfony/asset": "4.*",
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/expression-language": "4.*",
"symfony/form": "4.*",
"symfony/intl": "4.*",
"spomky-labs/base64url": "^2.0",
"symfony/asset": "^4.4",
"symfony/browser-kit": "^4.4",
"symfony/css-selector": "^4.4",
"symfony/expression-language": "^4.4",
"symfony/form": "^4.4",
"symfony/framework-bundle": "^4.4",
"symfony/intl": "^4.4",
"symfony/mailer": "^5.4",
"symfony/mime": "^5.4",
"symfony/monolog-bundle": "^3.5",
"symfony/security-bundle": "4.*",
"symfony/serializer": "^5.2",
"symfony/security-bundle": "^4.4",
"symfony/serializer": "^5.3",
"symfony/swiftmailer-bundle": "^3.5",
"symfony/templating": "4.*",
"symfony/translation": "4.*",
"symfony/templating": "^4.4",
"symfony/translation": "^4.4",
"symfony/twig-bundle": "^4.4",
"symfony/validator": "4.*",
"symfony/validator": "^4.4",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/workflow": "4.*",
"symfony/yaml": "4.*",
"twig/extra-bundle": "^2.12 || ^3.0",
"symfony/workflow": "^4.4",
"symfony/yaml": "^4.4",
"twig/extra-bundle": "^3.0",
"twig/intl-extra": "^3.0",
"twig/markdown-extra": "^3.3",
"twig/twig": "^2.12 || ^3.0"
"twig/string-extra": "^3.3",
"twig/twig": "^3.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3",
"drupol/php-conventions": "^5",
"fakerphp/faker": "^1.13",
"nelmio/alice": "^3.8",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": ">= 7.5",
"symfony/debug-bundle": "^5.1",
"symfony/dotenv": "^4.4",
"symfony/maker-bundle": "^1.20",
"symfony/phpunit-bridge": "^4.4",
"symfony/stopwatch": "^4.4",
"symfony/var-dumper": "^4.4",
"symfony/web-profiler-bundle": "^4.4"
},
"conflict": {
"symfony/symfony": "*"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3",
"fakerphp/faker": "^1.13",
"nelmio/alice": "^3.8",
"phpunit/phpunit": "^7.0",
"symfony/debug-bundle": "^5.1",
"symfony/dotenv": "^5.1",
"symfony/maker-bundle": "^1.20",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "^5.1",
"symfony/var-dumper": "4.*",
"symfony/web-profiler-bundle": "^5.0"
},
"config": {
"bin-dir": "bin",
"vendor-dir": "tests/app/vendor"
},
"autoload": {
"psr-4": {
"Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle",
"Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle/src",
"Chill\\BudgetBundle\\": "src/Bundle/ChillBudgetBundle",
"Chill\\CalendarBundle\\": "src/Bundle/ChillCalendarBundle",
"Chill\\CustomFieldsBundle\\": "src/Bundle/ChillCustomFieldsBundle",
"Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle",
"Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle",
"Chill\\EventBundle\\": "src/Bundle/ChillEventBundle",
"Chill\\FamilyMemberBundle\\": "src/Bundle/ChillFamilyMemberBundle",
@@ -78,23 +88,32 @@
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle",
"Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle/src",
"Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle",
"Chill\\CalendarBundle\\": "src/Bundle/ChillCalendarBundle",
"Chill\\WopiBundle\\": "src/Bundle/ChillWopiBundle/src"
}
},
"autoload-dev": {
"psr-4": {
"App\\": "tests/app/src/"
"App\\": "tests/app/src/",
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"ergebnis/composer-normalize": true,
"ocramius/package-versions": true,
"phpro/grumphp": true,
"phpstan/extension-installer": true
},
"bin-dir": "bin",
"optimize-autoloader": true,
"sort-packages": true,
"vendor-dir": "tests/app/vendor"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"cache:clear": "symfony-cmd"
}
}
}
@@ -1,123 +1,126 @@
<?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\PersonBundle\Export\Filter;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\FilterInterface;
use DateTime;
use Doctrine\ORM\Query\Expr;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Constraints;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Doctrine\ORM\Query\Expr;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Symfony\Component\Form\FormError;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
class BirthdateFilter implements FilterInterface, ExportElementValidatedInterface
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
{
// add specific role for this filter
// add specific role for this filter
public function addRole()
{
// we do not need any new role for this filter, so we return null
return null;
}
// here, we alter the query created by Export
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
// we create the clause here
$clause = $qb->expr()->between(
'person.birthdate',
':date_from',
':date_to'
);
// we have to take care **not to** remove previous clauses...
if ($where instanceof Expr\Andx) {
$where->add($clause);
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
// we add parameters from $data. $data contains the parameters from the form
$qb->setParameter('date_from', $data['date_from']);
$qb->setParameter('date_to', $data['date_to']);
}
// we give information on which type of export this filter applies
public function applyOn()
{
return 'person';
}
public function getTitle()
{
return 'Filter by person\'s birthdate';
}
// we build a form to collect some parameters from the users
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
{
$builder->add('date_from', DateType::class, array(
'label' => "Born after this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
$builder->add('date_from', DateType::class, [
'label' => 'Born after this date',
'data' => new DateTime(),
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add('date_to', DateType::class, array(
'label' => "Born before this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
]);
$builder->add('date_to', DateType::class, [
'label' => 'Born before this date',
'data' => new DateTime(),
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
));
}
// the form created above must be validated. The process of validation
// is executed here. This function is added by the interface
// `ExportElementValidatedInterface`, and can be ignore if there is
// no need for a validation
public function validateForm($data, ExecutionContextInterface $context)
{
$date_from = $data['date_from'];
$date_to = $data['date_to'];
if ($date_from === null) {
$context->buildViolation('The "date from" should not be empty')
//->atPath('date_from')
->addViolation();
}
if ($date_to === null) {
$context->buildViolation('The "date to" should not be empty')
//->atPath('date_to')
->addViolation();
}
if (
($date_from !== null && $date_to !== null)
&&
$date_from >= $date_to
) {
$context->buildViolation('The date "date to" should be after the '
. 'date given in "date from" field')
->addViolation();
}
}
// here, we alter the query created by Export
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
// we create the clause here
$clause = $qb->expr()->between('person.birthdate', ':date_from',
':date_to');
// we have to take care **not to** remove previous clauses...
if ($where instanceof Expr\Andx) {
$where->add($clause);
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
// we add parameters from $data. $data contains the parameters from the form
$qb->setParameter('date_from', $data['date_from']);
$qb->setParameter('date_to', $data['date_to']);
]);
}
// here, we create a simple string which will describe the action of
// the filter in the Response
public function describeAction($data, $format = 'string')
{
return array('Filtered by person\'s birtdate: '
. 'between %date_from% and %date_to%', array(
return ['Filtered by person\'s birtdate: '
. 'between %date_from% and %date_to%', [
'%date_from%' => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y')
));
'%date_to%' => $data['date_to']->format('d-m-Y'),
], ];
}
public function getTitle()
{
return 'Filter by person\'s birthdate';
}
// the form created above must be validated. The process of validation
// is executed here. This function is added by the interface
// `ExportElementValidatedInterface`, and can be ignore if there is
// no need for a validation
public function validateForm($data, ExecutionContextInterface $context)
{
$date_from = $data['date_from'];
$date_to = $data['date_to'];
if (null === $date_from) {
$context->buildViolation('The "date from" should not be empty')
//->atPath('date_from')
->addViolation();
}
if (null === $date_to) {
$context->buildViolation('The "date to" should not be empty')
//->atPath('date_to')
->addViolation();
}
if (
(null !== $date_from && null !== $date_to)
&& $date_from >= $date_to
) {
$context->buildViolation('The date "date to" should be after the '
. 'date given in "date from" field')
->addViolation();
}
}
}
@@ -1,118 +1,119 @@
<?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\PersonBundle\Export\Export;
use Chill\MainBundle\Export\ExportInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\Query;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Security\Core\Role\Role;
use Chill\PersonBundle\Export\Declarations;
use Chill\MainBundle\Export\FormatterInterface;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class CountPerson implements ExportInterface
{
/**
*
* @var EntityManagerInterface
*/
protected $entityManager;
public function __construct(
EntityManagerInterface $em
)
{
EntityManagerInterface $em
) {
$this->entityManager = $em;
}
public function getType()
public function buildForm(FormBuilderInterface $builder)
{
return Declarations::PERSON_TYPE;
// this export does not add any form
}
public function getAllowedFormattersTypes()
{
return [FormatterInterface::TYPE_TABULAR];
}
public function getDescription()
{
return "Count peoples by various parameters.";
return 'Count peoples by various parameters.';
}
public function getTitle()
public function getLabels($key, array $values, $data)
{
return "Count peoples";
// the Closure which will be executed by the formatter.
return function ($value) {
switch ($value) {
case '_header':
// we have to process specifically the '_header' string,
// which will be used by the formatter to show a column title
return $this->getTitle();
default:
// for all value, we do not process them and return them
// immediatly
return $value;
}
};
}
public function requiredRole()
{
return new Role(PersonVoter::STATS);
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
{
// we gather all center the user choose.
$centers = array_map(function($el) { return $el['center']; }, $acl);
$qb = $this->entityManager->createQueryBuilder();
$qb->select('COUNT(person.id) AS export_result')
->from('ChillPersonBundle:Person', 'person')
->join('person.center', 'center')
->andWhere('center IN (:authorized_centers)')
->setParameter('authorized_centers', $centers);
;
return $qb;
}
public function getResult($qb, $data)
{
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
public function getQueryKeys($data)
{
// this array match the result keys in the query. We have only
// one column.
return array('export_result');
return ['export_result'];
}
public function getLabels($key, array $values, $data)
public function getResult($qb, $data)
{
// the Closure which will be executed by the formatter.
return function($value) {
switch($value) {
case '_header':
// we have to process specifically the '_header' string,
// which will be used by the formatter to show a column title
return $this->getTitle();
default:
// for all value, we do not process them and return them
// immediatly
return $value;
};
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
public function getAllowedFormattersTypes()
public function getTitle()
{
return array(FormatterInterface::TYPE_TABULAR);
return 'Count peoples';
}
public function buildForm(FormBuilderInterface $builder) {
// this export does not add any form
public function getType()
{
return Declarations::PERSON_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
// we gather all center the user choose.
$centers = array_map(static function ($el) {
return $el['center'];
}, $acl);
$qb = $this->entityManager->createQueryBuilder();
$qb->select('COUNT(person.id) AS export_result')
->from('ChillPersonBundle:Person', 'person')
->join('person.center', 'center')
->andWhere('center IN (:authorized_centers)')
->setParameter('authorized_centers', $centers);
return $qb;
}
public function requiredRole()
{
return new Role(PersonVoter::STATS);
}
public function supportsModifiers()
{
// explain the export manager which formatters and filters are allowed
return array(Declarations::PERSON_TYPE, Declarations::PERSON_IMPLIED_IN);
return [Declarations::PERSON_TYPE, Declarations::PERSON_IMPLIED_IN];
}
}
+704 -84
View File
@@ -23,15 +23,196 @@ Every time an entity is created, viewed or updated, the software check if the us
The user must be granted access to the action on this particular entity, with this scope and center.
TL;DR
=====
Resolve scope and center
------------------------
In a service, resolve the center and scope of an entity
.. code-block:: php
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
class MyService {
private ScopeResolverDispatcher $scopeResolverDispatcher;
private CenterResolverDispatcher $centerResolverDispatcher;
public function myFunction($entity) {
/** @var null|Center[]|Center $center */
$center = $this->centerResolverDispatcher->resolveCenter($entity);
// $center may be null, an array of center, or an instance of Center
if ($this->scopeResolverDispatcher->isConcerned($entity) {
/** @var null|Scope[]|Scope */
$scope = $this-scopeResolverDispatcher->resolveScope($entity);
// $scope may be null, an array of Scope, or an instance of Scope
}
}
}
In twig template, resolve the center:
.. code-block:: twig
{# resolve a center #}
{% if person|chill_resolve_center is not null%}
{% if person|chill_resolve_center is iterable %}
{% set centers = person|chill_resolve_center %}
{% else %}
{% set centers = [ person|chill_resolve_center ] %}
{% endif %}
<span class="open_sansbold">
{{ 'Center'|trans|upper}} :
</span>
{% for c in centers %}
{{ c.name|upper }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
In twig template, resolve the scope:
.. code-block:: twig
{% if entity|chill_is_scope_concerned %}
{% if entity|chill_resolve_scope is iterable %}
{% set scopes = entity|chill_resolve_scope %}
{% else %}
{% set scopes = [ entity|chill_resolve_scope ] %}
{% endif %}
<span>Scopes&nbsp;:</span>
{% for s in scopes %}
{{ c.name|localize_translatable_string }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
Build a ``Voter``
-----------------
.. code-block:: php
<?php
namespace Chill\DocStoreBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface;
use Chill\MainBundle\Security\Authorization\VoterHelperInterface;
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
use Chill\DocStoreBundle\Entity\PersonDocument;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\Security;
class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
{
// roles should be stored into constants:
const CREATE = 'CHILL_PERSON_DOCUMENT_CREATE';
const SEE = 'CHILL_PERSON_DOCUMENT_SEE';
const SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS';
const UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE';
const DELETE = 'CHILL_PERSON_DOCUMENT_DELETE';
protected Security $security;
protected VoterHelperInterface $voterHelper;
public function __construct(
Security $security,
VoterHelperFactoryInterface $voterHelperFactory
) {
$this->security = $security;
// we build here a voter helper. This will ease the operations below.
// when the authorization model is changed, it will be easy to make a different implementation
// of the helper, instead of writing all Voters
$this->voterHelper = $voterHelperFactory
// create a builder with some context
->generate(self::class)
// add the support of given roles for given class:
->addCheckFor(Person::class, [self::SEE, self::CREATE])
->addCheckFor(PersonDocument::class, $this->getRoles())
->build();
}
protected function supports($attribute, $subject)
{
return $this->voterHelper->supports($attribute, $subject);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
// basic check
if (!$token->getUser() instanceof User) {
return false;
}
// we first check the acl for associated elements.
// here, we must be able to see the person associated to the document:
if ($subject instanceof PersonDocument
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
// not possible to see the associated person ? Then, not possible to see the document!
return false;
}
// the voter helper will implements the logic:
return $this->voterHelper->voteOnAttribute($attribute, $subject, $token);
}
// all the method below are used to register roles into the admin part
public function getRoles()
{
return [
self::CREATE,
self::SEE,
self::SEE_DETAILS,
self::UPDATE,
self::DELETE
];
}
public function getRolesWithoutScope()
{
return array();
}
public function getRolesWithHierarchy()
{
return ['PersonDocument' => $this->getRoles() ];
}
}
From an user point of view
--------------------------
==========================
The software is design to allow fine tuned access rights for complicated installation and team structure. The administrators may also decide that every user has the right to see all resources, where team have a more simple structure.
Here is an overview of the model.
Chill can be multi-center
^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------
Chill is designed to be installed once for social center who work with multiple teams separated, or for social services's federation who would like to share the same installation of the software for all their members.
@@ -42,7 +223,7 @@ Otherwise, it is not required to create multiple center: Chill can also work for
Obviously, users working in the different centers are not allowed to see the entities (_persons_, _reports_, _activities_) of other centers. But users may be attached to multiple centers: consequently they will be able to see the entities of the multiple centers they are attached to.
Inside center, scope divide team
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--------------------------------
Users are attached to one or more center and, inside to those center, there may exists differents scopes. The aim of those _scopes_ is to divide the whole team of social worker amongst different departement, for instance: the social team, the psychologist team, the nurse team, the administrative team, ... Each team is granted of different rights amongst scope. For instance, the social team may not see the _activities_ of the psychologist team. The administrative team may see the date & time's activities, but is not allowed to see the detail of those entities (the personal notes, ...).
@@ -52,8 +233,38 @@ As entities have only one scopes, if some entities must be shared across two dif
Example: if some activities must be seen and updated between nurses and psychologists, the administrator will create a scope "nurse and psy" and add the ability for both team "nurse" and "psychologist" to "create", "see", and "update" the activities belonging to scope "nurse and psy".
Where does the ``scope`` and ``center`` comes from ?
====================================================
Most often, scope and center comes from user's input:
* when person is created, Chill asks the associated center to the user. Then, every entity associated to the user (Activity, ...) is associated to this center;
* when an entity is created, Chill asks the associated scope.
The UI check the model before adding those input into form. If the user hae access to only one center or scope, this scope or center is filled automatically, and the UI does not ask the user. Most of the times, the user does not see "Pick a scope" and "Pick a center" inputs.
Scope and Center are associated to entities through ``ManyToOne`` properties, which are then mapped to ``FOREIGN KEY`` in tables, ...
But sometimes, this implementation does not fits the needs:
* persons are associated to center *geographically*: the address of each person contains lat/lon coordinates, and the center is resolved from this coordinated;
* some would like to associated persons to multiple center, or one center;
* entities are associated to scope through the job reached by "creator" (an user);
* some would like not to use scope at all;
*
For this reasons, associated center and scopes must be resolved programmatically. The default implementation rely on the model association, as described above. But it becomes possible to change the behaviour on different implementations.
Is my entity "concerned" by scopes ?
------------------------------------
Some entities are concerned by scope, some not.
This is also programmatically resolved.
The concepts translated into code
-----------------------------------
===================================
.. figure:: /_static/access_control_model.png
@@ -81,7 +292,7 @@ At each step of his lifetime (creation, view of the entity and eventually of his
All those action are executed through symfony voters and helpers.
How to check authorization ?
----------------------------
============================
Just use the symfony way-of-doing, but do not forget to associate the entity you want to check access. For instance, in controller :
@@ -100,34 +311,23 @@ Just use the symfony way-of-doing, but do not forget to associate the entity you
And in template :
.. code-block:: html+jinja
.. code-block:: twig
{{ if is_granted('CHILL_ENTITY_SEE', entity) %}print something{% endif %}
Retrieving reachable scopes and centers
----------------------------------------
Retrieving reachable scopes and centers for a user
--------------------------------------------------
The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelper` helps you to get centers and scope reachable by a user.
The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelperInterface` helps you to get centers and scope reachable by a user.
Those methods are intentionnaly build to give information about user rights:
- getReachableCenters: to get reachable centers for a user
- getReachableScopes : to get reachable scopes for a user
.. note::
The service is reachable through the Depedency injection with the key `chill.main.security.authorization.helper`. Example :
.. code-block:: php
$helper = $container->get('chill.main.security.authorization.helper');
.. todo::
Waiting for a link between our api and this doc, we invite you to read the method signatures `here <https://github.com/Chill-project/Main/blob/add_acl/Security/Authorization/AuthorizationHelper.php>`_
Adding your own roles
=====================
---------------------
Extending Chill will requires you to define your own roles and rules for your entities. You will have to define your own voter to do so.
@@ -152,7 +352,7 @@ To create your own roles, you should:
Declare your role
------------------
^^^^^^^^^^^^^^^^^^
To declare new role, implement the class :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`.
@@ -212,69 +412,8 @@ Example of an implementation of :class:`Chill\\MainBundle\\Security\\ProvideRole
}
Implement your voter
--------------------
Inside this class, you might use the :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelper` to check permission (do not re-invent the wheel). This is a real-world example:
.. code-block:: php
namespace Chill\ReportBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
class ReportVoter extends AbstractChillVoter
{
const CREATE = 'CHILL_REPORT_CREATE';
const SEE = 'CHILL_REPORT_SEE';
const UPDATE = 'CHILL_REPORT_UPDATE';
/**
*
* @var AuthorizationHelper
*/
protected $helper;
public function __construct(AuthorizationHelper $helper)
{
$this->helper = $helper;
}
protected function getSupportedAttributes()
{
return array(self::CREATE, self::SEE, self::UPDATE);
}
protected function getSupportedClasses()
{
return array('Chill\ReportBundle\Entity\Report');
}
protected function isGranted($attribute, $report, $user = null)
{
if (! $user instanceof \Chill\MainBundle\Entity\User){
return false;
}
return $this->helper->userHasAccess($user, $report, $attribute);
}
}
Then, you will have to declare the service and tag it as a voter :
.. code-block:: yaml
services:
chill.report.security.authorization.report_voter:
class: Chill\ReportBundle\Security\Authorization\ReportVoter
arguments:
- "@chill.main.security.authorization.helper"
tags:
- { name: security.voter }
Adding role hierarchy
---------------------
^^^^^^^^^^^^^^^^^^^^^
You should prepend Symfony's security component directly from your code.
@@ -312,3 +451,484 @@ You should prepend Symfony's security component directly from your code.
}
Implement your voter
^^^^^^^^^^^^^^^^^^^^
Most of the time, Voter will check that:
1. The given role is reachable (= ``$attribute``)
2. for the given center,
3. and, if any, for the given role
4. if the entity is associated to another entity, this entity should be, at least, viewable by the user.
Thats what we call the "autorization logic". But this logic may be replace by a new one, and developers should take care of it.
Then voter implementation should take care of:
* check the access to associated entities. For instance, if an ``Activity`` is associated to a ``Person``, the voter should first check that the user can show the associated ``Person``;
* as far as possible, delegates the check for associated center, scopes, and check for authorization using the authorization logic. VoterHelper will ease the most common operation of this logic.
This is an example of implementation:
.. code-block:: php
<?php
namespace Chill\DocStoreBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface;
use Chill\MainBundle\Security\Authorization\VoterHelperInterface;
use Chill\DocStoreBundle\Entity\PersonDocument;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Security;
class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
{
protected Security $security;
protected VoterHelperInterface $voterHelper;
public function __construct(
Security $security,
VoterHelperFactoryInterface $voterHelperFactory
) {
$this->security = $security;
// we build here a voter helper. This will ease the operations below.
// when the authorization model is changed, it will be easy to make a different implementation
// of the helper, instead of writing all Voters
$this->voterHelper = $voterHelperFactory
// create a builder with some context
->generate(self::class)
// add the support of given roles for given class:
->addCheckFor(Person::class, [self::SEE, self::CREATE])
->addCheckFor(PersonDocument::class, $this->getRoles())
->build();
}
protected function supports($attribute, $subject)
{
return $this->voterHelper->supports($attribute, $subject);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
// basic check
if (!$token->getUser() instanceof User) {
return false;
}
// we first check the acl for associated elements.
// here, we must be able to see the person associated to the document:
if ($subject instanceof PersonDocument
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
// not possible to see the associated person ? Then, not possible to see the document!
return false;
}
// the voter helper will implements the logic of checking:
// 1. that the center is reachable
// 2. for this given entity
// 3. for this given scope
// 4. and for the given role
return $this->voterHelper->voteOnAttribute($attribute, $subject, $token);
}
public function getRoles()
{
// ...
}
public function getRolesWithoutScope()
{
// ...
}
public function getRolesWithHierarchy()
{
// ...
}
}
Then, you will have to declare the service and tag it as a voter :
.. code-block:: yaml
services:
chill.report.security.authorization.report_voter:
class: Chill\ReportBundle\Security\Authorization\ReportVoter
arguments:
- "@chill.main.security.authorization.helper"
tags:
- { name: security.voter }
How to resolve scope and center programmatically ?
==================================================
In a service, resolve the center and scope of an entity
.. code-block:: php
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
class MyService {
private ScopeResolverDispatcher $scopeResolverDispatcher;
private CenterResolverDispatcher $centerResolverDispatcher;
public function myFunction($entity) {
/** @var null|Center[]|Center $center */
$center = $this->centerResolverDispatcher->resolveCenter($entity);
// $center may be null, an array of center, or an instance of Center
if ($this->scopeResolverDispatcher->isConcerned($entity) {
/** @var null|Scope[]|Scope */
$scope = $this-scopeResolverDispatcher->resolveScope($entity);
// $scope may be null, an array of Scope, or an instance of Scope
}
}
}
In twig template, resolve the center:
.. code-block:: twig
{# resolve a center #}
{% if person|chill_resolve_center is not null%}
{% if person|chill_resolve_center is iterable %}
{% set centers = person|chill_resolve_center %}
{% else %}
{% set centers = [ person|chill_resolve_center ] %}
{% endif %}
<span class="open_sansbold">
{{ 'Center'|trans|upper}} :
</span>
{% for c in centers %}
{{ c.name|upper }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
In twig template, resolve the scope:
.. code-block:: twig
{% if entity|chill_is_scope_concerned %}
{% if entity|chill_resolve_scope is iterable %}
{% set scopes = entity|chill_resolve_scope %}
{% else %}
{% set scopes = [ entity|chill_resolve_scope ] %}
{% endif %}
<span>Scopes&nbsp;:</span>
{% for s in scopes %}
{{ c.name|localize_translatable_string }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
What is the default implementation of Scope and Center resolver ?
-----------------------------------------------------------------
By default, the implementation rely on association into entities.
* implements ``Chill\MainBundle\Entity\HasCenterInterface`` on entities which have one or any center;
* implements ``Chill\MainBundle\Entity\HasCentersInterface`` on entities which have one, multiple or any centers;
* implements ``Chill\MainBundle\Entity\HasScopeInterface`` on entities which have one or any scope;
* implements ``Chill\MainBundle\Entity\HasScopesInterface`` on entities which have one or any scopes;
Then, the default implementation will resolve the center and scope based on the implementation in your model.
How to change the default behaviour ?
-------------------------------------
Implements those interface into services:
* ``Chill\MainBundle\Security\Resolver\CenterResolverInterface``;
* ``Chill\MainBundle\Security\Resolver\ScopeResolverInterface``;
Authorization into lists and index pages
========================================
Due to the fact that authorization model may be overriden, "list" and "index" pages should not rely on center and scope from controller. This must be delegated to dedicated service, which will be aware of the authorization model. We call them ``ACLAwareRepository``. This service must implements an interface, in order to allow to change the implementation.
The controller **must not** performs any DQL or SQL query.
Example in a controller:
.. code-block:: php
namespace Chill\TaskBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface;
final class SingleTaskController extends AbstractController
{
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository;
/**
*
* @Route(
* "/{_locale}/task/single-task/list",
* name="chill_task_singletask_list"
* )
*/
public function listAction(
Request $request
) {
$this->denyAccessUnlessGranted(TaskVoter::SHOW, null);
$nb = $this->singleTaskAclAwareRepository->countByAllViewable(
'', // search pattern
[] // search flags
);
$paginator = $this->paginatorFactory->create($nb);
if (0 < $nb) {
$tasks = $this->singleTaskAclAwareRepository->findByAllViewable(
'', // search pattern
[] // search flags
$paginator->getCurrentPageFirstItemNumber(),
$paginator->getItemsPerPage(),
// ordering:
[
'startDate' => 'DESC',
'endDate' => 'DESC',
]
);
} else {
$tasks = [];
}
return $this->render('@ChillTask/SingleTask/List/index.html.twig', [
'tasks' => $tasks,
'paginator' => $paginator,
'filter_order' => $filterOrder
]);
}
}
Writing ``ACLAwareRepository``
------------------------------
The ACLAwareRepository should rely on interfaces
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As described above, the ACLAwareRepository will perform the query for listing entities, and take care of authorization.
Those "ACLAwareRepositories" must be described into ``interfaces``.
The service must rely on this interface, and not on the default implementation.
Example: at first, we design an interface for listing ``SingleTask`` entities:
.. code-block:: php
<?php
namespace Chill\TaskBundle\Repository;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
interface SingleTaskAclAwareRepositoryInterface
{
/**
* @return SingleTask[]|array
*/
public function findByCurrentUsersTasks(?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = []): array;
public function countByCurrentUsersTasks(?string $pattern = null, ?array $flags = []): int;
public function countByAllViewable(
?string $pattern = null,
?array $flags = []
): int;
/**
* @return SingleTask[]|array
*/
public function findByAllViewable(
?string $pattern = null,
?array $flags = [],
?int $start = 0,
?int $limit = 50,
?array $orderBy = []
): array;
}
Implements this interface and register the interface as an alias for the implementation.
.. code-block:: yaml
services:
Chill\TaskBundle\Repository\SingleTaskAclAwareRepository:
autowire: true
autoconfigure: true
Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface: '@Chill\TaskBundle\Repository\SingleTaskAclAwareRepository'
Write the basic implementation for re-use: separate authorization logic and search logic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The logic of such repository may be separated into two logic:
* the authorization logic (show only entities that the user is allowed to see);
* the search logic (filter entities on some criterias).
This logic should be separated into your implementation.
Considering this simple interface:
.. code-block:: php
interface MyEntityACLAwareRepositoryInterface {
public function countByAuthorized(array $criterias): int;
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array;
}
The base implementation should separate the logic to allow an easy reuse. Here, the method ``buildQuery`` build a basic query without authorization logic, which can be re-used. The authorization logic is dedicated to a private method. For ease of user, the logic of adding ordering criterias and pagination parameters (``$start`` and ``$limit``) are also delegated to a public method.
.. code-block:: php
namespace Chill\MyBundle\Repository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
final class MyEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
private EntityManagerInterface $em;
// constructor omitted
public function countByAuthorized(array $criterias): int
{
$qb = $this->buildQuery($criterias);
return $this->addAuthorizations($qb)->select("COUNT(e)")->getQuery()->getResult()->getSingleScalarResult();
}
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array
{
$qb = $this->buildQuery($criterias);
return $this->getResult($this->addAuthorizations($qb), $start, $limit, $orderBy);
}
public function getResult(QueryBuilder $qb, int $start, int $limit, array $orderBy): array
{
$qb
->setFirstResult($start)
->setMaxResults($limit)
;
// add order by logic
return $qb->getQuery()->getResult();
}
public function buildQuery(array $criterias): QueryBuilder
{
$qb = $this->em->createQueryBuilder();
// implement you logic with search criteria here
return $qb;
}
private function addAuthorizations(QueryBuilder $qb): QueryBuilder
{
// add authorization logic here
return $qb;
}
}
Once this logic is executed, it becomes easy to make a new implementation of the repository:
.. code-block:: php
namespace Chill\MyOtherBundle\Repository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MyBundle\Repository\MyEntityACLAwareRepository
final class AnotherEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
private EntityManagerInterface $em;
private \Chill\MyBundle\Repository\MyEntityACLAwareRepository $initial;
public function __construct(
EntityManagerInterface $em,
\Chill\MyBundle\Repository\MyEntityACLAwareRepository $initial
) {
$this->em = $em;
$this->initial = $initial;
}
public function countByAuthorized(array $criterias): int
{
$qb = $this->initial->buildQuery($criterias);
return $this->addAuthorizations($qb)->select("COUNT(e)")->getQuery()->getResult()->getSingleScalarResult();
}
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array
{
$qb = $this->initial->buildQuery($criterias);
return $this->initial->getResult($this->addAuthorizations($qb), $start, $limit, $orderBy);
}
private function addAuthorizations(QueryBuilder $qb): QueryBuilder
{
// add a different authorization logic here
return $qb;
}
}
Then, register this service and decorates the old one:
.. code-block:: yaml
services:
Chill\MyOtherBundle\Repository\AnotherEntityACLAwareRepository:
autowire: true
autoconfigure: true
decorates: Chill\MyBundle\Repository\MyEntityACLAwareRepositoryInterface:
+1 -1
View File
@@ -32,7 +32,7 @@ Then, render the pagination using the dedicated twig function.
{% block title 'Item list'|trans %}
{% block personcontent %}
{% block content %}
<table>
+26 -19
View File
@@ -1,42 +1,49 @@
<?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\MyBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class ItemController extends Controller {
public function yourAction()
class example extends Controller
{
public function yourAction()
{
$em = $this->getDoctrine()->getManager();
// first, get the number of total item are available
$total = $em
->createQuery("SELECT COUNT (item.id) FROM ChillMyBundle:Item item")
->getSingleScalarResult();
->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item')
->getSingleScalarResult();
// get the PaginatorFactory
$paginatorFactory = $this->get('chill_main.paginator_factory');
// create a pagination instance. This instance is only valid for
// create a pagination instance. This instance is only valid for
// the current route and parameters
$paginator = $paginatorFactory->create($total);
// launch your query on item. Limit the query to the results
// for the current page using the paginator
$items = $em->createQuery("SELECT item FROM ChillMyBundle:Item item WHERE <your clause>")
$items = $em->createQuery('SELECT item FROM ChillMyBundle:Item item WHERE <your clause>')
// use the paginator to get the first item number
->setFirstResult($paginator->getCurrentPage()->getFirstItemNumber())
// use the paginator to get the number of items to display
->setMaxResults($paginator->getItemsPerPage());
return $this->render('ChillMyBundle:Item:list.html.twig', array(
return $this->render(
'ChillMyBundle:Item:list.html.twig',
[
'items' => $items,
'paginator' => $paginator
);
'paginator' => $paginator,
]
);
}
}
@@ -1,43 +1,53 @@
<?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\HealthBundle\Controller;
use Chill\HealthBundle\Security\Authorization\ConsultationVoter;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\Role\Role;
class ConsultationController extends Controller
{
/**
*
* @param int $id personId
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws type
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function listAction($id)
{
/* @var $person \Chill\PersonBundle\Entity\Person */
/** @var \Chill\PersonBundle\Entity\Person $person */
$person = $this->get('chill.person.repository.person')
->find($id);
if ($person === null) {
throw $this->createNotFoundException("The person is not found");
if (null === $person) {
throw $this->createNotFoundException('The person is not found');
}
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person);
/* @var $authorizationHelper \Chill\MainBundle\Security\Authorization\AuthorizationHelper */
/** @var \Chill\MainBundle\Security\Authorization\AuthorizationHelper $authorizationHelper */
$authorizationHelper = $this->get('chill.main.security.'
. 'authorization.helper');
$circles = $authorizationHelper->getReachableCircles(
$this->getUser(),
new Role(ConsultationVoter::SEE),
$this->getUser(),
new Role(ConsultationVoter::SEE),
$person->getCenter()
);
// create a query which take circles into account
);
// create a query which take circles into account
$consultations = $this->getDoctrine()->getManager()
->createQuery('SELECT c FROM ChillHealthBundle:Consultation c '
. 'WHERE c.patient = :person AND c.circle IN(:circles) '
@@ -45,11 +55,10 @@ class ConsultationController extends Controller
->setParameter('person', $person)
->setParameter('circles', $circles)
->getResult();
return $this->render('ChillHealthBundle:Consultation:list.html.twig', array(
'person' => $person,
'consultations' => $consultations
));
return $this->render('ChillHealthBundle:Consultation:list.html.twig', [
'person' => $person,
'consultations' => $consultations,
]);
}
}
@@ -156,7 +156,7 @@ This layout extend `ChillMainBundle::layoutWithVerticalMenu.html.twig` add the p
It proposes 1 new block :
* personcontent
* content
* where to display the information of the person
@@ -1,64 +1,63 @@
<?php
# Chill\MainBundle\DependencyInjection\Configuration.php
namespace Chill\MainBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* 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.
*/
/**
* Configure the main bundle
*/
class Configuration implements ConfigurationInterface
{
use AddWidgetConfigurationTrait;
/**
*
* @var ContainerBuilder
*/
private $containerBuilder;
declare(strict_types=1);
public function __construct(array $widgetFactories = array(),
ContainerBuilder $containerBuilder)
{
// we register here widget factories (see below)
$this->setWidgetFactories($widgetFactories);
// we will need the container builder later...
$this->containerBuilder = $containerBuilder;
}
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('chill_main');
namespace Chill\MainBundle\DependencyInjection;
$rootNode
->children()
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
// ...
/**
* Configure the main bundle.
*/
class ChillMainConfiguration implements ConfigurationInterface
{
use AddWidgetConfigurationTrait;
->arrayNode('widgets')
->canBeDisabled()
->children()
// we declare here all configuration for homepage place
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
->end() // end of widgets/children
->end() // end of widgets
->end() // end of root/children
->end() // end of root
;
/**
* @var ContainerBuilder
*/
private $containerBuilder;
return $treeBuilder;
}
}
public function __construct(
array $widgetFactories,
ContainerBuilder $containerBuilder
) {
// we register here widget factories (see below)
$this->setWidgetFactories($widgetFactories);
// we will need the container builder later...
$this->containerBuilder = $containerBuilder;
}
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('chill_main');
$rootNode
->children()
// ...
->arrayNode('widgets')
->canBeDisabled()
->children()
// we declare here all configuration for homepage place
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
->end() // end of widgets/children
->end() // end of widgets
->end() // end of root/children
->end() // end of root
;
return $treeBuilder;
}
}
@@ -1,16 +1,19 @@
<?php
#Chill\MainBundle\DependencyInjection\ChillMainExtension.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\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
use Chill\MainBundle\DependencyInjection\Configuration;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* This class load config for chillMainExtension.
@@ -18,42 +21,42 @@ use Chill\MainBundle\DependencyInjection\Configuration;
class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesExtensionInterface
{
/**
* widget factory
*
* widget factory.
*
* @var WidgetFactoryInterface[]
*/
protected $widgetFactories = array();
protected $widgetFactories = [];
public function addWidgetFactory(WidgetFactoryInterface $factory)
{
$this->widgetFactories[] = $factory;
}
public function getConfiguration(array $config, ContainerBuilder $container)
{
return new Configuration($this->widgetFactories, $container);
}
/**
*
* @return WidgetFactoryInterface[]
*/
public function getWidgetFactories()
{
return $this->widgetFactories;
}
public function load(array $configs, ContainerBuilder $container)
{
// configuration for main bundle
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
// add the key 'widget' without the key 'enable'
$container->setParameter('chill_main.widgets',
array('homepage' => $config['widgets']['homepage']));
// ...
// add the key 'widget' without the key 'enable'
$container->setParameter(
'chill_main.widgets',
['homepage' => $config['widgets']['homepage']]
);
// ...
}
public function getConfiguration(array $config, ContainerBuilder $container)
{
return new Configuration($this->widgetFactories, $container);
}
}
@@ -1,69 +1,73 @@
<?php
# Chill/PersonBundle/Widget/PersonListWidgetFactory
/**
* 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\PersonBundle\Widget;
use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\Definition\Builder\NodeBuilder;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* add configuration for the person_list widget.
*/
class PersonListWidgetFactory extends AbstractWidgetFactory
class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
{
/*
* append the option to the configuration
* see http://symfony.com/doc/current/components/config/definition.html
*
*/
/*
* append the option to the configuration
* see http://symfony.com/doc/current/components/config/definition.html
*
*/
public function configureOptions($place, NodeBuilder $node)
{
$node->booleanNode('only_active')
->defaultTrue()
->end();
->defaultTrue()
->end();
$node->integerNode('number_of_items')
->defaultValue(50)
->end();
$node->scalarNode('filtering_class')
->defaultNull()
->end();
->defaultNull()
->end();
}
/*
* return an array with the allowed places where the widget can be rendered
*
* @return string[]
*/
/**
* return an array with the allowed places where the widget can be rendered.
*
* @return string[]
*/
public function getAllowedPlaces()
{
return array('homepage');
return ['homepage'];
}
/*
* return the widget alias
*
* @return string
*/
public function getWidgetAlias()
{
return 'person_list';
}
/*
* return the service id for the service which will render the widget.
*
* this service must implements `Chill\MainBundle\Templating\Widget\WidgetInterface`
*
* the service must exists in the container, and it is not required that the service
*
* the service must exists in the container, and it is not required that the service
* has the `chill_main` tag.
*/
public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config)
{
return 'chill_person.widget.person_list';
}
}
/**
* return the widget alias.
*
* @return string
*/
public function getWidgetAlias()
{
return 'person_list';
}
}
@@ -1,66 +1,73 @@
<?php
# Chill/PersonBundle/Widget/PersonListWidget.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\PersonBundle\Widget;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Templating\Widget\WidgetInterface;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use DateTime;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr;
use Doctrine\DBAL\Types\Type;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Security\Core\User\UserInterface;
use Twig_Environment;
/**
* add a widget with person list.
*
* add a widget with person list.
*
* The configuration is defined by `PersonListWidgetFactory`
*/
class PersonListWidget implements WidgetInterface
class ChillPersonAddAPersonWidget implements WidgetInterface
{
/**
* Repository for persons
*
* @var EntityRepository
* the authorization helper.
*
* @var AuthorizationHelper;
*/
protected $personRepository;
protected $authorizationHelper;
/**
* The entity manager
* The entity manager.
*
* @var EntityManager
*/
protected $entityManager;
/**
* the authorization helper
*
* @var AuthorizationHelper;
*/
protected $authorizationHelper;
/**
* Repository for persons.
*
* @var EntityRepository
*/
protected $personRepository;
/**
* @var TokenStorage
*/
protected $tokenStorage;
/**
*
* @var UserInterface
*/
protected $user;
public function __construct(
EntityRepository $personRepostory,
EntityManager $em,
AuthorizationHelper $authorizationHelper,
TokenStorage $tokenStorage
) {
EntityRepository $personRepostory,
EntityManager $em,
AuthorizationHelper $authorizationHelper,
TokenStorage $tokenStorage
) {
$this->personRepository = $personRepostory;
$this->authorizationHelper = $authorizationHelper;
$this->tokenStorage = $tokenStorage;
@@ -68,27 +75,24 @@ class PersonListWidget implements WidgetInterface
}
/**
*
* @param type $place
* @param array $context
* @param array $config
*
* @return string
*/
public function render(\Twig_Environment $env, $place, array $context, array $config)
{
public function render(Twig_Environment $env, $place, array $context, array $config)
{
$qb = $this->personRepository
->createQueryBuilder('person');
->createQueryBuilder('person');
// show only the person from the authorized centers
$and = $qb->expr()->andX();
$centers = $this->authorizationHelper
->getReachableCenters($this->getUser(), new Role(PersonVoter::SEE));
->getReachableCenters($this->getUser(), new Role(PersonVoter::SEE));
$and->add($qb->expr()->in('person.center', ':centers'));
$qb->setParameter('centers', $centers);
// add the "only active" where clause
if ($config['only_active'] === true) {
if (true === $config['only_active']) {
$qb->join('person.accompanyingPeriods', 'ap');
$or = new Expr\Orx();
// add the case where closingDate IS NULL
@@ -98,32 +102,30 @@ class PersonListWidget implements WidgetInterface
$or->add($andWhenClosingDateIsNull);
// add the case when now is between opening date and closing date
$or->add(
(new Expr())->between(':now', 'ap.openingDate', 'ap.closingDate')
);
(new Expr())->between(':now', 'ap.openingDate', 'ap.closingDate')
);
$and->add($or);
$qb->setParameter('now', new \DateTime(), Type::DATE);
$qb->setParameter('now', new DateTime(), Type::DATE);
}
// adding the where clause to the query
$qb->where($and);
$qb->setFirstResult(0)->setMaxResults($config['number_of_items']);
$persons = $qb->getQuery()->getResult();
return $env->render(
'ChillPersonBundle:Widget:homepage_person_list.html.twig',
array('persons' => $persons)
);
['persons' => $persons]
);
}
/**
*
* @return UserInterface
*/
private function getUser()
{
// return a user
}
}
@@ -1,51 +1,48 @@
<?php
# Chill/PersonBundle/DependencyInjection/ChillPersonExtension.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\PersonBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Chill\MainBundle\DependencyInjection\MissingBundleException;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* This is the class that loads and manages your bundle configuration
* This is the class that loads and manages your bundle configuration.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class ChillPersonExtension extends Extension implements PrependExtensionInterface
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
// ...
// ...
}
/**
*
* Add a widget "add a person" on the homepage, automatically
*
* Add a widget "add a person" on the homepage, automatically.
*
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
*/
public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', array(
'widgets' => array(
'homepage' => array(
array(
$container->prependExtensionConfig('chill_main', [
'widgets' => [
'homepage' => [
[
'widget_alias' => 'add_person',
'order' => 2
)
)
)
));
'order' => 2,
],
],
],
]);
}
}
+39
View File
@@ -0,0 +1,39 @@
imports:
- {
resource: tests/app/vendor/drupol/php-conventions/config/php73/grumphp.yml,
}
parameters:
tasks.phpcsfixer.config: .php_cs.dist.php
tasks.license.name: AGPL-3.0
tasks.license.holder: Champs-Libres
tasks.license.date_from: 2001
tasks.phpcsfixer.allow_risky: true
tasks.phpcsfixer.diff: true
tasks.phpstan.level: 1
tasks.phpstan.blocking: true
tasks.phpstan.ignore_patterns:
- "/.github/"
- "/.idea/"
- "/build/"
- "/benchmarks/"
- "/docs/"
- "/node_modules/"
- "/resource/"
- "/spec/"
- "/var/"
- "/vendor/"
# Psalm
tasks.psalm.blocking: true
tasks.psalm.ignore_patterns:
- "/.github/"
- "/.idea/"
- "/build/"
- "/benchmarks/"
- "/node_modules/"
- "/resource/"
- "/spec/"
- "/var/"
- "/vendor/"
-3
View File
@@ -1,3 +0,0 @@
add npm/yarn dependency in package.json :
"select2-bootstrap-theme": "0.1.0-beta.10",
+96
View File
@@ -0,0 +1,96 @@
parameters:
ignoreErrors:
-
message: "#^Variable property access on \\$this\\(Chill\\\\ActivityBundle\\\\Entity\\\\ActivityType\\)\\.$#"
count: 3
path: src/Bundle/ChillActivityBundle/Entity/ActivityType.php
-
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
-
message: "#^Variable \\$participation might not be defined\\.$#"
count: 3
path: src/Bundle/ChillEventBundle/Controller/ParticipationController.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
-
message: "#^Variable method call on object\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
-
message: "#^Cannot unset offset '_token' on array\\{formatter\\: mixed, export\\: mixed, centers\\: mixed, alias\\: string\\}\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
-
message: "#^Foreach overwrites \\$line with its value variable\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php
-
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
-
message: "#^Foreach overwrites \\$key with its value variable\\.$#"
count: 3
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
-
message: "#^Variable \\$message on left side of \\?\\? always exists and is not nullable\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
-
message: "#^Variable \\$sqls on left side of \\?\\? always exists and is not nullable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
-
message: "#^Class Chill\\\\PersonBundle\\\\Entity\\\\Person constructor invoked with 1 parameter, 0 required\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Variable \\$street1Value might not be defined\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Variable method call on mixed\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
-
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php
-
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
+91
View File
@@ -0,0 +1,91 @@
parameters:
ignoreErrors:
-
message: "#^Implicit array creation is not allowed \\- variable \\$centers might not exist\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:\\$currentHouseholdParticipationAt\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Entity/Person.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\PersonHouseholdAddress\\:\\:\\$relation\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:\\$work\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
-
message: "#^Undefined variable\\: \\$person$#"
count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
-
message: "#^Variable variables are not allowed\\.$#"
count: 4
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Function Chill\\\\PersonBundle\\\\Serializer\\\\Normalizer\\\\·\\\\is_array not found\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
-
message: "#^Undefined variable\\: \\$choiceSlug$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message: "#^Undefined variable\\: \\$choiceSlug$#"
count: 1
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message: "#^Undefined variable\\: \\$type$#"
count: 1
path: src/Bundle/ChillTaskBundle/Controller/TaskController.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\AbstractCRUDController\\:\\:getRoleFor\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Controller\\\\UserController\\:\\:createEditForm\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/UserController.php
-
message: "#^Undefined variable\\: \\$current$#"
count: 1
path: src/Bundle/ChillMainBundle/Pagination/PageGenerator.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:getSupportedAttributes\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:getSupportedClasses\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:isGranted\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Controller\\\\PersonController\\:\\:\\$security\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
-
message: "#^Call to an undefined method Chill\\\\ThirdPartyBundle\\\\Form\\\\Type\\\\PickThirdPartyTypeCategoryType\\:\\:transform\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php
File diff suppressed because it is too large Load Diff
+462
View File
@@ -0,0 +1,462 @@
parameters:
ignoreErrors:
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReason.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
-
message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getDescription\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
-
message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getTitle\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#"
count: 3
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 3
path: src/Bundle/ChillBudgetBundle/Form/ChargeType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillBudgetBundle/Form/ResourceType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 4
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldChoice\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldDate\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldLongChoice\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldNumber\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldText\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldTitle\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php
-
message: "#^Method Chill\\\\EventBundle\\\\Entity\\\\Participation\\:\\:offsetGet\\(\\) should return mixed but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Entity/Participation.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
-
message: "#^Parameter \\$resolver of method Chill\\\\EventBundle\\\\Form\\\\EventTypeType\\:\\:setDefaultOptions\\(\\) has invalid type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/EventTypeType.php
-
message: "#^Parameter \\$resolver of method Chill\\\\EventBundle\\\\Form\\\\RoleType\\:\\:setDefaultOptions\\(\\) has invalid type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/RoleType.php
-
message: "#^Parameter \\$resolver of method Chill\\\\EventBundle\\\\Form\\\\StatusType\\:\\:setDefaultOptions\\(\\) has invalid type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/StatusType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
-
message: "#^Method Chill\\\\EventBundle\\\\Search\\\\EventSearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 5
path: src/Bundle/ChillFamilyMembersBundle/Entity/AbstractFamilyMember.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: "#^Parameter \\$scope of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getReachableCenters\\(\\) has invalid type Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\Scope\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
-
message: "#^Method Chill\\\\MainBundle\\\\CRUD\\\\Resolver\\\\Resolver\\:\\:getConfigValue\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\ChillImportUsersCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\ChillUserSendRenewPasswordCodeCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadAndUpdateLanguagesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadCountriesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadPostalCodesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\SetPasswordCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/PasswordController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/PostalCodeController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/Address.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/User.php
-
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/DataMapper/AddressDataMapper.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Form/Type/AddressType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Form/Type/AddressType.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 3
path: src/Bundle/ChillMainBundle/Form/Type/DataTransformer/DateIntervalTransformer.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
-
message: "#^Method Chill\\\\MainBundle\\\\Timeline\\\\TimelineBuilder\\:\\:getTemplateData\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
-
message: "#^Method Chill\\\\PersonBundle\\\\Command\\\\ChillPersonMoveCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 6
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/CountryOfBirthAggregator.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/NationalityAggregator.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php
-
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Method Chill\\\\PersonBundle\\\\Search\\\\PersonSearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
-
message: "#^Method Chill\\\\ReportBundle\\\\DataFixtures\\\\ORM\\\\LoadReports\\:\\:getRandomChoice\\(\\) should return array\\<string\\>\\|string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message: "#^Method Chill\\\\ReportBundle\\\\Security\\\\Authorization\\\\ReportVoter\\:\\:supports\\(\\) should return bool but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 3
path: src/Bundle/ChillTaskBundle/Entity/AbstractTask.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 5
path: src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php
-
message: "#^Method Chill\\\\TaskBundle\\\\Timeline\\\\SingleTaskTaskLifeCycleEventTimelineProvider\\:\\:getTransitionByName\\(\\) should return Symfony\\\\Component\\\\Workflow\\\\Transition but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php
-
message: "#^Method Chill\\\\TaskBundle\\\\Timeline\\\\TaskLifeCycleEventTimelineProvider\\:\\:getTransitionByName\\(\\) should return Symfony\\\\Component\\\\Workflow\\\\Transition but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php
-
message: "#^Method Chill\\\\ThirdPartyBundle\\\\Search\\\\ThirdPartySearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php
+26
View File
@@ -0,0 +1,26 @@
parameters:
level: 1
paths:
- src/
excludePaths:
- docs/
- src/Bundle/*/Tests/*
- src/Bundle/*/tests/*
- src/Bundle/*/Test/*
- src/Bundle/*/config/*
- src/Bundle/*/migrations/*
- src/Bundle/*/translations/*
- src/Bundle/*/Resources/*
- src/Bundle/*/src/Tests/*
- src/Bundle/*/src/Test/*
- src/Bundle/*/src/config/*
- src/Bundle/*/src/migrations/*
- src/Bundle/*/src/translations/*
- src/Bundle/*/src/Resources/*
includes:
- phpstan-baseline.neon
- phpstan-critical.neon
- phpstan-deprecations.neon
- phpstan-types.neon
+4 -1
View File
@@ -2,7 +2,7 @@
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="tests/app/vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/app/tests/bootstrap.php"
@@ -37,6 +37,9 @@
<testsuite name="CalendarBundle">
<directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory>
</testsuite>
<testsuite name="DocGeneratorBundle">
<directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory>
</testsuite>
</testsuites>
<listeners>
+1523
View File
File diff suppressed because it is too large Load Diff
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config tests/app/vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="./tests/" />
</ignoreFiles>
</projectFiles>
</psalm>
+5
View File
@@ -0,0 +1,5 @@
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.
@@ -27,3 +27,4 @@ Version 1.5.5
=============
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
- fix bug: error when trying to edit activity of which the type has been deactivated
@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
@@ -1,85 +1,281 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Chill\ActivityBundle\Repository\ActivityACLAwareRepository;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Form\ActivityType;
use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Repository\ActivityTypeCategoryRepository;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Repository\LocationRepository;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Privacy\PrivacyEvent;
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
use Chill\PersonBundle\Repository\PersonRepository;
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
use InvalidArgumentException;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Form\ActivityType;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Symfony\Component\Serializer\SerializerInterface;
use function array_key_exists;
/**
* Class ActivityController
*
* @package Chill\ActivityBundle\Controller
*/
class ActivityController extends AbstractController
final class ActivityController extends AbstractController
{
protected EventDispatcherInterface $eventDispatcher;
private AccompanyingPeriodRepository $accompanyingPeriodRepository;
protected AuthorizationHelper $authorizationHelper;
private ActivityACLAwareRepositoryInterface $activityACLAwareRepository;
protected LoggerInterface $logger;
private ActivityRepository $activityRepository;
protected SerializerInterface $serializer;
private ActivityTypeCategoryRepository $activityTypeCategoryRepository;
protected ActivityACLAwareRepositoryInterface $activityACLAwareRepository;
private ActivityTypeRepository $activityTypeRepository;
private EntityManagerInterface $entityManager;
private EventDispatcherInterface $eventDispatcher;
private LocationRepository $locationRepository;
private LoggerInterface $logger;
private PersonRepository $personRepository;
private SerializerInterface $serializer;
private ThirdPartyRepository $thirdPartyRepository;
public function __construct(
ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
ActivityTypeRepository $activityTypeRepository,
ActivityTypeCategoryRepository $activityTypeCategoryRepository,
PersonRepository $personRepository,
ThirdPartyRepository $thirdPartyRepository,
LocationRepository $locationRepository,
ActivityRepository $activityRepository,
AccompanyingPeriodRepository $accompanyingPeriodRepository,
EntityManagerInterface $entityManager,
EventDispatcherInterface $eventDispatcher,
AuthorizationHelper $authorizationHelper,
LoggerInterface $logger,
SerializerInterface $serializer
) {
$this->activityACLAwareRepository = $activityACLAwareRepository;
$this->activityTypeRepository = $activityTypeRepository;
$this->activityTypeCategoryRepository = $activityTypeCategoryRepository;
$this->personRepository = $personRepository;
$this->thirdPartyRepository = $thirdPartyRepository;
$this->locationRepository = $locationRepository;
$this->activityRepository = $activityRepository;
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
$this->entityManager = $entityManager;
$this->eventDispatcher = $eventDispatcher;
$this->authorizationHelper = $authorizationHelper;
$this->logger = $logger;
$this->serializer = $serializer;
}
/**
* Deletes a Activity entity.
*
* @param mixed $id
*/
public function deleteAction(Request $request, $id)
{
$view = null;
[$person, $accompanyingPeriod] = $this->getEntity($request);
$activity = $this->activityRepository->find($id);
if (!$activity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig';
$accompanyingPeriod = $activity->getAccompanyingPeriod();
} else {
$view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig';
}
// TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity);
$form = $this->createDeleteForm($activity->getId(), $person, $accompanyingPeriod);
if ($request->getMethod() === Request::METHOD_DELETE) {
$form->handleRequest($request);
if ($form->isValid()) {
$this->logger->notice('An activity has been removed', [
'by_user' => $this->getUser()->getUsername(),
'activity_id' => $activity->getId(),
'person_id' => $activity->getPerson() ? $activity->getPerson()->getId() : null,
'comment' => $activity->getComment()->getComment(),
'scope_id' => $activity->getScope() ? $activity->getScope()->getId() : null,
'reasons_ids' => $activity->getReasons()
->map(
static fn (ActivityReason $ar): int => $ar->getId()
)
->toArray(),
'type_id' => $activity->getActivityType()->getId(),
'duration' => $activity->getDurationTime() ? $activity->getDurationTime()->format('U') : null,
'date' => $activity->getDate()->format('Y-m-d'),
'attendee' => $activity->getAttendee(),
]);
$this->entityManager->remove($activity);
$this->entityManager->flush();
$this->addFlash('success', $this->get('translator')
->trans('The activity has been successfully removed.'));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
return $this->redirectToRoute('chill_activity_activity_list', $params);
}
}
if (null === $view) {
throw $this->createNotFoundException('Template not found');
}
return $this->render($view, [
'activity' => $activity,
'delete_form' => $form->createView(),
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
]);
}
/**
* Displays a form to edit an existing Activity entity.
*/
public function editAction(int $id, Request $request): Response
{
$view = null;
$entity = $this->activityRepository->find($id);
if (null === $entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$accompanyingPeriod = $entity->getAccompanyingPeriod();
$person = $entity->getPerson();
if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
$accompanyingPeriod = $entity->getAccompanyingPeriod();
} else {
$view = 'ChillActivityBundle:Activity:editPerson.html.twig';
}
// TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
$form = $this->createForm(ActivityType::class, $entity, [
'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_UPDATE'),
'activityType' => $entity->getActivityType(),
'accompanyingPeriod' => $accompanyingPeriod,
]);
if ($form->has('documents')) {
$form->add('gendocTemplateId', HiddenType::class, [
'mapped' => false,
'data' => null,
'attr' => [
// required for js
'data-template-id' => 'data-template-id',
],
]);
}
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->entityManager->persist($entity);
$this->entityManager->flush();
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
$params['id'] = $entity->getId();
if ($form->has('gendocTemplateId') && null !== $form['gendocTemplateId']->getData()) {
return $this->redirectToRoute(
'chill_docgenerator_generate_from_template',
[
'template' => $form->get('gendocTemplateId')->getData(),
'entityClassName' => Activity::class,
'entityId' => $entity->getId(),
'returnPath' => $this->generateUrl('chill_activity_activity_edit', $params),
]
);
}
$this->addFlash('success', $this->get('translator')->trans('Success : activity updated!'));
return $this->redirectToRoute('chill_activity_activity_show', $params);
}
$deleteForm = $this->createDeleteForm($entity->getId(), $person, $accompanyingPeriod);
/*
* TODO
$event = new PrivacyEvent($person, array(
'element_class' => Activity::class,
'element_id' => $entity->getId(),
'action' => 'edit'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
*/
if (null === $view) {
throw $this->createNotFoundException('Template not found');
}
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
return $this->render($view, [
'entity' => $entity,
'edit_form' => $form->createView(),
'delete_form' => $deleteForm->createView(),
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'activity_json' => $activity_array,
]);
}
/**
* Lists all Activity entities.
*/
public function listAction(Request $request): Response
{
$em = $this->getDoctrine()->getManager();
$view = null;
$activities = [];
// TODO: add pagination
[$person, $accompanyingPeriod] = $this->getEntity($request);
@@ -87,12 +283,12 @@ class ActivityController extends AbstractController
if ($person instanceof Person) {
$this->denyAccessUnlessGranted(ActivityVoter::SEE, $person);
$activities = $this->activityACLAwareRepository
->findByPerson($person, ActivityVoter::SEE, 0, null);
->findByPerson($person, ActivityVoter::SEE, 0, null, ['date' => 'DESC', 'id' => 'DESC']);
$event = new PrivacyEvent($person, array(
$event = new PrivacyEvent($person, [
'element_class' => Activity::class,
'action' => 'list'
));
'action' => 'list',
]);
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
$view = 'ChillActivityBundle:Activity:listPerson.html.twig';
@@ -100,67 +296,24 @@ class ActivityController extends AbstractController
$this->denyAccessUnlessGranted(ActivityVoter::SEE, $accompanyingPeriod);
$activities = $this->activityACLAwareRepository
->findByAccompanyingPeriod($accompanyingPeriod, ActivityVoter::SEE);
->findByAccompanyingPeriod($accompanyingPeriod, ActivityVoter::SEE, 0, null, ['date' => 'DESC', 'id' => 'DESC']);
$view = 'ChillActivityBundle:Activity:listAccompanyingCourse.html.twig';
}
return $this->render($view, array(
'activities' => $activities,
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
));
}
public function selectTypeAction(Request $request): Response
{
$em = $this->getDoctrine()->getManager();
$view = null;
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:selectTypeAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:selectTypePerson.html.twig';
}
$data = [];
$activityTypeCategories = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityTypeCategory::class)
->findBy(['active' => true], ['ordering' => 'ASC']);
foreach ($activityTypeCategories as $activityTypeCategory) {
$activityTypes = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityType::class)
->findBy(['active' => true, 'category' => $activityTypeCategory], ['ordering' => 'ASC']);
$data[] = [
'activityTypeCategory' => $activityTypeCategory,
'activityTypes' => $activityTypes,
];
}
if ($request->query->has('activityData')) {
$activityData = $request->query->get('activityData');
} else {
$activityData = [];
}
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'data' => $data,
'activityData' => $activityData
]);
return $this->render(
$view,
[
'activities' => $activities,
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
]
);
}
public function newAction(Request $request): Response
{
$em = $this->getDoctrine()->getManager();
$view = null;
[$person, $accompanyingPeriod] = $this->getEntity($request);
@@ -171,22 +324,28 @@ class ActivityController extends AbstractController
}
$activityType_id = $request->get('activityType_id', 0);
$activityType = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityType::class)
->find($activityType_id);
$activityType = $this->activityTypeRepository->find($activityType_id);
if (isset($activityType) && !$activityType->isActive()) {
throw new InvalidArgumentException('Activity type must be active');
}
$activityData = null;
if ($request->query->has('activityData')) {
$activityData = $request->query->get('activityData');
}
if (!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType ||
!$activityType->isActive()) {
if (
!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
|| !$activityType->isActive()
) {
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
if (null !== $activityData) {
$params['activityData'] = $activityData;
}
return $this->redirectToRoute('chill_activity_activity_select_type', $params);
}
@@ -201,8 +360,8 @@ class ActivityController extends AbstractController
$entity->setAccompanyingPeriod($accompanyingPeriod);
}
$entity->setType($activityType);
$entity->setDate(new \DateTime('now'));
$entity->setActivityType($activityType);
$entity->setDate(new DateTime('now'));
if ($request->query->has('activityData')) {
$activityData = $request->query->get('activityData');
@@ -211,56 +370,88 @@ class ActivityController extends AbstractController
$durationTimeInMinutes = $activityData['durationTime'];
$hours = floor($durationTimeInMinutes / 60);
$minutes = $durationTimeInMinutes % 60;
$duration = \DateTime::createFromFormat("H:i", $hours.':'.$minutes);
$duration = DateTime::createFromFormat('H:i', $hours . ':' . $minutes);
if ($duration) {
$entity->setDurationTime($duration);
}
}
if (array_key_exists('date', $activityData)) {
$date = \DateTime::createFromFormat('Y-m-d', $activityData['date']);
$date = DateTime::createFromFormat('Y-m-d', $activityData['date']);
if ($date) {
$entity->setDate($date);
}
}
if (array_key_exists('personsId', $activityData)) {
foreach($activityData['personsId'] as $personId){
$concernedPerson = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($personId);
foreach ($activityData['personsId'] as $personId) {
$concernedPerson = $this->personRepository->find($personId);
$entity->addPerson($concernedPerson);
}
}
if (array_key_exists('professionalsId', $activityData)) {
foreach($activityData['professionalsId'] as $professionalsId){
$professional = $em->getRepository(\Chill\ThirdPartyBundle\Entity\ThirdParty::class)->find($professionalsId);
foreach ($activityData['professionalsId'] as $professionalsId) {
$professional = $this->thirdPartyRepository->find($professionalsId);
$entity->addThirdParty($professional);
}
}
if (array_key_exists('location', $activityData)) {
$location = $this->locationRepository->find($activityData['location']);
$entity->setLocation($location);
}
if (array_key_exists('comment', $activityData)) {
$comment = new CommentEmbeddable();
$comment->setComment($activityData['comment']);
$comment->setUserId($this->getUser()->getid());
$comment->setDate(new \DateTime('now'));
$comment->setDate(new DateTime('now'));
$entity->setComment($comment);
}
}
// TODO revoir le Voter de Activity pour tenir compte qu'une activité peut appartenir a une période
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity);
$this->denyAccessUnlessGranted(ActivityVoter::CREATE, $entity);
$form = $this->createForm(ActivityType::class, $entity, [
'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_CREATE'),
'activityType' => $entity->getType(),
'role' => new Role('CHILL_ACTIVITY_CREATE'),
'activityType' => $entity->getActivityType(),
'accompanyingPeriod' => $accompanyingPeriod,
])->handleRequest($request);
]);
if ($form->has('documents')) {
$form->add('gendocTemplateId', HiddenType::class, [
'mapped' => false,
'data' => null,
'attr' => [
// required for js
'data-template-id' => 'data-template-id',
],
]);
}
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em->persist($entity);
$em->flush();
$this->entityManager->persist($entity);
$this->entityManager->flush();
if ($form->has('gendocTemplateId') && null !== $form['gendocTemplateId']->getData()) {
return $this->redirectToRoute(
'chill_docgenerator_generate_from_template',
[
'template' => $form->get('gendocTemplateId')->getData(),
'entityClassName' => Activity::class,
'entityId' => $entity->getId(),
'returnPath' => $this->generateUrl('chill_activity_activity_edit', [
'id' => $entity->getId(),
]),
]
);
}
$this->addFlash('success', $this->get('translator')->trans('Success : activity created!'));
@@ -271,48 +462,96 @@ class ActivityController extends AbstractController
return $this->redirectToRoute('chill_activity_activity_show', $params);
}
if ($view === null) {
if (null === $view) {
throw $this->createNotFoundException('Template not found');
}
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
$defaultLocation = $this->getUser()->getCurrentLocation();
return $this->render($view, [
'person' => $person,
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'entity' => $entity,
'form' => $form->createView(),
'activity_json' => $activity_array
'activity_json' => $activity_array,
'default_location' => $defaultLocation,
]);
}
public function showAction(Request $request, $id): Response
public function selectTypeAction(Request $request): Response
{
$em = $this->getDoctrine()->getManager();
$view = null;
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:selectTypeAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:selectTypePerson.html.twig';
}
$data = [];
$activityTypeCategories = $this
->activityTypeCategoryRepository
->findBy(['active' => true], ['ordering' => 'ASC']);
foreach ($activityTypeCategories as $activityTypeCategory) {
$activityTypes = $this
->activityTypeRepository
->findBy(
['active' => true, 'category' => $activityTypeCategory],
['ordering' => 'ASC']
);
$data[] = [
'activityTypeCategory' => $activityTypeCategory,
'activityTypes' => $activityTypes,
];
}
if (null === $view) {
throw $this->createNotFoundException('Template not found');
}
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'data' => $data,
'activityData' => $request->query->get('activityData', []),
]);
}
public function showAction(Request $request, int $id): Response
{
$entity = $this->activityRepository->find($id);
if (null === $entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$accompanyingPeriod = $entity->getAccompanyingPeriod();
$person = $entity->getPerson();
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:showAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:showPerson.html.twig';
}
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
} else {
throw new RuntimeException('the activity should be linked with a period or person');
}
if (null !== $accompanyingPeriod) {
$entity->personsAssociated = $entity->getPersonsAssociated();
$entity->personsNotAssociated = $entity->getPersonsNotAssociated();
// @TODO: Properties created dynamically.
$entity->personsAssociated = $entity->getPersonsAssociated();
$entity->personsNotAssociated = $entity->getPersonsNotAssociated();
}
// TODO revoir le Voter de Activity pour tenir compte qu'une activité peut appartenir a une période
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity);
$this->denyAccessUnlessGranted(ActivityVoter::SEE, $entity);
$deleteForm = $this->createDeleteForm($id, $person, $accompanyingPeriod);
$deleteForm = $this->createDeleteForm($entity->getId(), $person, $accompanyingPeriod);
// TODO
/*
@@ -322,166 +561,39 @@ class ActivityController extends AbstractController
'action' => 'show'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
*/
*/
if ($view === null) {
if (null === $view) {
throw $this->createNotFoundException('Template not found');
}
return $this->render($view, array(
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
));
}
/**
* Displays a form to edit an existing Activity entity.
*
*/
public function editAction($id, Request $request): Response
{
$em = $this->getDoctrine()->getManager();
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:editPerson.html.twig';
}
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
// TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
$form = $this->createForm(ActivityType::class, $entity, [
'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_UPDATE'),
'activityType' => $entity->getType(),
'accompanyingPeriod' => $accompanyingPeriod,
])->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em->persist($entity);
$em->flush();
$this->addFlash('success', $this->get('translator')->trans('Success : activity updated!'));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
$params['id'] = $id;
return $this->redirectToRoute('chill_activity_activity_show', $params);
}
$deleteForm = $this->createDeleteForm($id, $person, $accompanyingPeriod);
/*
* TODO
$event = new PrivacyEvent($person, array(
'element_class' => Activity::class,
'element_id' => $entity->getId(),
'action' => 'edit'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
*/
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
return $this->render($view, array(
'entity' => $entity,
'edit_form' => $form->createView(),
'delete_form' => $deleteForm->createView(),
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'activity_json' => $activity_array
));
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
]);
}
/**
* Deletes a Activity entity.
*
*/
public function deleteAction(Request $request, $id)
private function buildParamsToUrl(?Person $person, ?AccompanyingPeriod $accompanyingPeriod): array
{
$em = $this->getDoctrine()->getManager();
$params = [];
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig';
if (null !== $person) {
$params['person_id'] = $person->getId();
}
/* @var $activity Activity */
$activity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$activity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
if (null !== $accompanyingPeriod) {
$params['accompanying_period_id'] = $accompanyingPeriod->getId();
}
// TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity);
$form = $this->createDeleteForm($id, $person, $accompanyingPeriod);
if ($request->getMethod() === Request::METHOD_DELETE) {
$form->handleRequest($request);
if ($form->isValid()) {
$this->logger->notice("An activity has been removed", array(
'by_user' => $this->getUser()->getUsername(),
'activity_id' => $activity->getId(),
'person_id' => $activity->getPerson() ? $activity->getPerson()->getId() : null,
'comment' => $activity->getComment()->getComment(),
'scope_id' => $activity->getScope() ? $activity->getScope()->getId() : null,
'reasons_ids' => $activity->getReasons()
->map(function ($ar) { return $ar->getId(); })
->toArray(),
'type_id' => $activity->getType()->getId(),
'duration' => $activity->getDurationTime() ? $activity->getDurationTime()->format('U') : null,
'date' => $activity->getDate()->format('Y-m-d'),
'attendee' => $activity->getAttendee()
));
$em->remove($activity);
$em->flush();
$this->addFlash('success', $this->get('translator')
->trans("The activity has been successfully removed."));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
return $this->redirectToRoute('chill_activity_activity_list', $params);
}
}
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
return $this->render($view, array(
'activity' => $activity,
'delete_form' => $form->createView(),
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
));
return $params;
}
/**
* Creates a form to delete a Activity entity by id.
*/
private function createDeleteForm(int $id, ?Person $person, ?AccompanyingPeriod $accompanyingPeriod): Form
private function createDeleteForm(int $id, ?Person $person, ?AccompanyingPeriod $accompanyingPeriod): FormInterface
{
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
$params['id'] = $id;
@@ -489,58 +601,40 @@ class ActivityController extends AbstractController
return $this->createFormBuilder()
->setAction($this->generateUrl('chill_activity_activity_delete', $params))
->setMethod('DELETE')
->add('submit', SubmitType::class, array('label' => 'Delete'))
->getForm()
;
->add('submit', SubmitType::class, ['label' => 'Delete'])
->getForm();
}
private function getEntity(Request $request): array
{
$em = $this->getDoctrine()->getManager();
$person = $accompanyingPeriod = null;
$person = $accompanyingPeriod = null;
if ($request->query->has('person_id')) {
$person_id = $request->get('person_id');
$person = $em->getRepository(Person::class)->find($person_id);
$person = $this->personRepository->find($person_id);
if ($person === null) {
if (null === $person) {
throw $this->createNotFoundException('Person not found');
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
} elseif ($request->query->has('accompanying_period_id')) {
$accompanying_period_id = $request->get('accompanying_period_id');
$accompanyingPeriod = $em->getRepository(AccompanyingPeriod::class)->find($accompanying_period_id);
$accompanyingPeriod = $this->accompanyingPeriodRepository->find($accompanying_period_id);
if ($accompanyingPeriod === null) {
if (null === $accompanyingPeriod) {
throw $this->createNotFoundException('Accompanying Period not found');
}
// TODO Add permission
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
} else {
throw $this->createNotFoundException("Person or Accompanying Period not found");
throw $this->createNotFoundException('Person or Accompanying Period not found');
}
return [
$person, $accompanyingPeriod
$person,
$accompanyingPeriod,
];
}
private function buildParamsToUrl(
?Person $person,
?AccompanyingPeriod $accompanyingPeriod
): array {
$params = [];
if ($person) {
$params['person_id'] = $person->getId();
}
if ($accompanyingPeriod) {
$params['accompanying_period_id'] = $accompanyingPeriod->getId();
}
return $params;
}
}
@@ -1,38 +1,29 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
/**
* ActivityReasonCategory controller.
*
*/
class ActivityReasonCategoryController extends AbstractController
{
/**
* Lists all ActivityReasonCategory entities.
*
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->findAll();
return $this->render('ChillActivityBundle:ActivityReasonCategory:index.html.twig', array(
'entities' => $entities,
));
}
/**
* Creates a new ActivityReasonCategory entity.
*
*/
public function createAction(Request $request)
{
@@ -45,71 +36,19 @@ class ActivityReasonCategoryController extends AbstractController
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory_show', array('id' => $entity->getId())));
return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory_show', ['id' => $entity->getId()]));
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', array(
return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', [
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Creates a form to create a ActivityReasonCategory entity.
*
* @param ActivityReasonCategory $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityReasonCategory $entity)
{
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, array(
'action' => $this->generateUrl('chill_activity_activityreasoncategory_create'),
'method' => 'POST',
));
$form->add('submit', SubmitType::class, array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new ActivityReasonCategory entity.
*
*/
public function newAction()
{
$entity = new ActivityReasonCategory();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a ActivityReasonCategory entity.
*
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:show.html.twig', array(
'entity' => $entity,
));
'form' => $form->createView(),
]);
}
/**
* Displays a form to edit an existing ActivityReasonCategory entity.
*
* @param mixed $id
*/
public function editAction($id)
{
@@ -123,33 +62,64 @@ class ActivityReasonCategoryController extends AbstractController
$editForm = $this->createEditForm($entity);
return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
));
return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', [
'entity' => $entity,
'edit_form' => $editForm->createView(),
]);
}
/**
* Creates a form to edit a ActivityReasonCategory entity.
*
* @param ActivityReasonCategory $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityReasonCategory $entity)
* Lists all ActivityReasonCategory entities.
*/
public function indexAction()
{
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, array(
'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$em = $this->getDoctrine()->getManager();
$form->add('submit', SubmitType::class, array('label' => 'Update'));
$entities = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->findAll();
return $form;
return $this->render('ChillActivityBundle:ActivityReasonCategory:index.html.twig', [
'entities' => $entities,
]);
}
/**
* Displays a form to create a new ActivityReasonCategory entity.
*/
public function newAction()
{
$entity = new ActivityReasonCategory();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', [
'entity' => $entity,
'form' => $form->createView(),
]);
}
/**
* Finds and displays a ActivityReasonCategory entity.
*
* @param mixed $id
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:show.html.twig', [
'entity' => $entity,
]);
}
/**
* Edits an existing ActivityReasonCategory entity.
*
* @param mixed $id
*/
public function updateAction(Request $request, $id)
{
@@ -167,12 +137,50 @@ class ActivityReasonCategoryController extends AbstractController
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory_edit', array('id' => $id)));
return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory_edit', ['id' => $id]));
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
));
return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', [
'entity' => $entity,
'edit_form' => $editForm->createView(),
]);
}
/**
* Creates a form to create a ActivityReasonCategory entity.
*
* @param ActivityReasonCategory $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityReasonCategory $entity)
{
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, [
'action' => $this->generateUrl('chill_activity_activityreasoncategory_create'),
'method' => 'POST',
]);
$form->add('submit', SubmitType::class, ['label' => 'Create']);
return $form;
}
/**
* Creates a form to edit a ActivityReasonCategory entity.
*
* @param ActivityReasonCategory $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityReasonCategory $entity)
{
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, [
'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', ['id' => $entity->getId()]),
'method' => 'PUT',
]);
$form->add('submit', SubmitType::class, ['label' => 'Update']);
return $form;
}
}
@@ -1,38 +1,29 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Form\ActivityReasonType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
/**
* ActivityReason controller.
*
*/
class ActivityReasonController extends AbstractController
{
/**
* Lists all ActivityReason entities.
*
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillActivityBundle:ActivityReason')->findAll();
return $this->render('ChillActivityBundle:ActivityReason:index.html.twig', array(
'entities' => $entities,
));
}
/**
* Creates a new ActivityReason entity.
*
*/
public function createAction(Request $request)
{
@@ -45,71 +36,19 @@ class ActivityReasonController extends AbstractController
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('chill_activity_activityreason', array('id' => $entity->getId())));
return $this->redirect($this->generateUrl('chill_activity_activityreason', ['id' => $entity->getId()]));
}
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array(
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', [
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Creates a form to create a ActivityReason entity.
*
* @param ActivityReason $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityReason $entity)
{
$form = $this->createForm(ActivityReasonType::class, $entity, array(
'action' => $this->generateUrl('chill_activity_activityreason_create'),
'method' => 'POST',
));
$form->add('submit', SubmitType::class, array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new ActivityReason entity.
*
*/
public function newAction()
{
$entity = new ActivityReason();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a ActivityReason entity.
*
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
}
return $this->render('ChillActivityBundle:ActivityReason:show.html.twig', array(
'entity' => $entity,
));
'form' => $form->createView(),
]);
}
/**
* Displays a form to edit an existing ActivityReason entity.
*
* @param mixed $id
*/
public function editAction($id)
{
@@ -123,33 +62,64 @@ class ActivityReasonController extends AbstractController
$editForm = $this->createEditForm($entity);
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView()
));
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', [
'entity' => $entity,
'edit_form' => $editForm->createView(),
]);
}
/**
* Creates a form to edit a ActivityReason entity.
*
* @param ActivityReason $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityReason $entity)
* Lists all ActivityReason entities.
*/
public function indexAction()
{
$form = $this->createForm(ActivityReasonType::class, $entity, array(
'action' => $this->generateUrl('chill_activity_activityreason_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$em = $this->getDoctrine()->getManager();
$form->add('submit', SubmitType::class, array('label' => 'Update'));
$entities = $em->getRepository('ChillActivityBundle:ActivityReason')->findAll();
return $form;
return $this->render('ChillActivityBundle:ActivityReason:index.html.twig', [
'entities' => $entities,
]);
}
/**
* Displays a form to create a new ActivityReason entity.
*/
public function newAction()
{
$entity = new ActivityReason();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', [
'entity' => $entity,
'form' => $form->createView(),
]);
}
/**
* Finds and displays a ActivityReason entity.
*
* @param mixed $id
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
}
return $this->render('ChillActivityBundle:ActivityReason:show.html.twig', [
'entity' => $entity,
]);
}
/**
* Edits an existing ActivityReason entity.
*
* @param mixed $id
*/
public function updateAction(Request $request, $id)
{
@@ -167,12 +137,50 @@ class ActivityReasonController extends AbstractController
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('chill_activity_activityreason', array('id' => $id)));
return $this->redirect($this->generateUrl('chill_activity_activityreason', ['id' => $id]));
}
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView()
));
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', [
'entity' => $entity,
'edit_form' => $editForm->createView(),
]);
}
/**
* Creates a form to create a ActivityReason entity.
*
* @param ActivityReason $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityReason $entity)
{
$form = $this->createForm(ActivityReasonType::class, $entity, [
'action' => $this->generateUrl('chill_activity_activityreason_create'),
'method' => 'POST',
]);
$form->add('submit', SubmitType::class, ['label' => 'Create']);
return $form;
}
/**
* Creates a form to edit a ActivityReason entity.
*
* @param ActivityReason $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityReason $entity)
{
$form = $this->createForm(ActivityReasonType::class, $entity, [
'action' => $this->generateUrl('chill_activity_activityreason_update', ['id' => $entity->getId()]),
'method' => 'PUT',
]);
$form->add('submit', SubmitType::class, ['label' => 'Update']);
return $form;
}
}
@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
@@ -9,10 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
class AdminActivityPresenceController extends CRUDController
{
/**
* @param string $action
* @param \Doctrine\ORM\QueryBuilder|mixed $query
* @param Request $request
* @param PaginatorInterface $paginator
*
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
@@ -9,10 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
class AdminActivityTypeCategoryController extends CRUDController
{
/**
* @param string $action
* @param \Doctrine\ORM\QueryBuilder|mixed $query
* @param Request $request
* @param PaginatorInterface $paginator
*
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
@@ -9,15 +18,14 @@ use Symfony\Component\HttpFoundation\Request;
class AdminActivityTypeController extends CRUDController
{
/**
* @param string $action
* @param \Doctrine\ORM\QueryBuilder|mixed $query
* @param Request $request
* @param PaginatorInterface $paginator
*
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
/** @var \Doctrine\ORM\QueryBuilder $query */
return $query->orderBy('e.ordering', 'ASC');
return $query->orderBy('e.ordering', 'ASC')
->addOrderBy('e.id', 'ASC');
}
}
@@ -1,33 +1,20 @@
<?php
/*
/**
* Chill is a software for social workers
* Copyright (C) 2015 Champs Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
/**
* Controller for activity configuration
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
* @author Champs Libres <info@champs-libres.coop>
* Controller for activity configuration.
*/
class AdminController extends AbstractController
{
@@ -35,7 +22,7 @@ class AdminController extends AbstractController
{
return $this->render('ChillActivityBundle:Admin:layout_activity.html.twig');
}
public function redirectToAdminIndexAction()
{
return $this->redirectToRoute('chill_main_admin_central');
@@ -1,55 +1,41 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
use Chill\MainBundle\DataFixtures\ORM\LoadUsers;
use Chill\PersonBundle\Entity\Person;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory as FakerFactory;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\DataFixtures\ORM\LoadUsers;
use Chill\ActivityBundle\DataFixtures\ORM\LoadActivityReason;
use Chill\ActivityBundle\DataFixtures\ORM\LoadActivityType;
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
/**
* Load reports into DB
*
* @author Champs-Libres Coop
*/
class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
{
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
private EntityManagerInterface $em;
/**
* @var \Faker\Generator
*/
private $faker;
public function __construct()
public function __construct(EntityManagerInterface $em)
{
$this->faker = FakerFactory::create('fr_FR');
$this->em = $em;
}
public function getOrder()
@@ -57,57 +43,27 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
return 16400;
}
/**
* Return a random scope
*
* @return \Chill\MainBundle\Entity\Scope
*/
private function getRandomScope()
public function load(ObjectManager $manager)
{
$scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)];
return $this->getReference($scopeRef);
}
$persons = $this->em
->getRepository(Person::class)
->findAll();
/**
* Return a random activityType
*
* @return \Chill\ActivityBundle\Entity\ActivityType
*/
private function getRandomActivityType()
{
$typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)];
return $this->getReference($typeRef);
}
foreach ($persons as $person) {
$activityNbr = mt_rand(0, 3);
/**
* Return a random activityReason
*
* @return \Chill\ActivityBundle\Entity\ActivityReason
*/
private function getRandomActivityReason(array $excludingIds)
{
$reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)];
for ($i = 0; $i < $activityNbr; ++$i) {
$activity = $this->newRandomActivity($person);
if (in_array($this->getReference($reasonRef)->getId(), $excludingIds)) {
// we have a reason which should be excluded. Find another...
return $this->getRandomActivityReason($excludingIds);
if (null !== $activity) {
$manager->persist($activity);
}
}
}
return $this->getReference($reasonRef);
$manager->flush();
}
/**
* Return a random user
*
* @return \Chill\MainBundle\Entity\User
*/
private function getRandomUser()
{
$userRef = array_rand(LoadUsers::$refs);
return $this->getReference($userRef);
}
public function newRandomActivity($person)
public function newRandomActivity($person): ?Activity
{
$activity = (new Activity())
->setUser($this->getRandomUser())
@@ -115,39 +71,68 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
->setDate($this->faker->dateTimeThisYear())
->setDurationTime($this->faker->dateTime(36000))
->setType($this->getRandomActivityType())
->setScope($this->getRandomScope())
;
->setScope($this->getRandomScope());
// ->setAttendee($this->faker->boolean())
$usedId = array();
for ($i = 0; $i < rand(0, 4); $i++) {
$reason = $this->getRandomActivityReason($usedId);
$usedId[] = $reason->getId();
$activity->addReason($reason);
for ($i = 0; mt_rand(0, 4) > $i; ++$i) {
$reason = $this->getRandomActivityReason();
if (null !== $reason) {
$activity->addReason($reason);
} else {
return null;
}
}
return $activity;
}
public function load(ObjectManager $manager)
/**
* Return a random activityReason.
*
* @return \Chill\ActivityBundle\Entity\ActivityReason
*/
private function getRandomActivityReason()
{
$persons = $this->container->get('doctrine.orm.entity_manager')
->getRepository('ChillPersonBundle:Person')
->findAll();
$reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)];
foreach($persons as $person) {
$activityNbr = rand(0,3);
$ref = 'activity_'.$person->getFullnameCanonical();
return $this->getReference($reasonRef);
}
for($i = 0; $i < $activityNbr; $i ++) {
print "Creating an activity type for : ".$person." (ref: ".$ref.") \n";
$activity = $this->newRandomActivity($person);
$manager->persist($activity);
}
/**
* Return a random activityType.
*
* @return \Chill\ActivityBundle\Entity\ActivityType
*/
private function getRandomActivityType()
{
$typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)];
$this->setReference($ref, $activity);
}
$manager->flush();
return $this->getReference($typeRef);
}
/**
* Return a random scope.
*
* @return \Chill\MainBundle\Entity\Scope
*/
private function getRandomScope()
{
$scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)];
return $this->getReference($scopeRef);
}
/**
* Return a random user.
*
* @return \Chill\MainBundle\Entity\User
*/
private function getRandomUser()
{
$userRef = array_rand(LoadUsers::$refs);
return $this->getReference($userRef);
}
}
@@ -1,15 +1,23 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\DataFixtures\ORM\LoadAbstractNotificationsTrait;
use Chill\ActivityBundle\DataFixtures\ORM\LoadActivity;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
/**
* Load notififications into database
* Load notififications into database.
*/
class LoadActivityNotifications extends AbstractFixture implements DependentFixtureInterface
{
@@ -25,9 +33,9 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt
'center a_social',
'center a_administrative',
'center a_direction',
'multi_center'
'multi_center',
],
]
],
];
public function getDependencies()
@@ -1,81 +1,68 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityReason;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\ActivityBundle\Entity\ActivityReason;
/**
* Description of LoadActivityReason
*
* @author Champs-Libres Coop
* Description of LoadActivityReason.
*/
class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterface
{
public static $references = [];
public function getOrder()
{
return 16300;
}
public static $references = array();
public function load(ObjectManager $manager)
{
$reasons = [
[
'name' => ['fr' => 'Recherche logement', 'en' => 'Housing research', 'nl' => 'Woning zoektoch'],
'category' => 'cat_Housing'],
'category' => 'cat_Housing', ],
[
'name' => ['fr' => 'Problème avec propriétaire', 'en' => 'Landlord problems', 'nl' => 'Huisbaas problemen'],
'category' => 'cat_Housing'],
'category' => 'cat_Housing', ],
[
'name' => ['fr' => 'Retard de payement', 'en' => 'Payement problems', 'nl' => 'Betalings vertragingen'],
'category' => 'cat_Housing'],
'category' => 'cat_Housing', ],
[
'name' => ['fr' => 'Explication législation', 'en' => 'Legislation explanation', 'nl' => 'Legislative uitleg'],
'category' => 'cat_Unemployment procedure'],
'category' => 'cat_Unemployment procedure', ],
[
'name' => ['fr' => 'Coaching entretien d\'activation', 'en' => 'Interview coaching', 'nl' => 'Interview coaching'],
'category' => 'cat_Unemployment procedure'],
'category' => 'cat_Unemployment procedure', ],
[
'name' => ['fr' => 'Récupération des allocations', 'en' => 'Allowance recovery', 'nl' => 'Terugwinning van de uitkeringen'],
'category' => 'cat_Unemployment procedure']
'category' => 'cat_Unemployment procedure', ],
];
foreach ($reasons as $r) {
print "Creating activity reason : " . $r['name']['en'] . "\n";
echo 'Creating activity reason : ' . $r['name']['en'] . "\n";
$activityReason = (new ActivityReason())
->setName(($r['name']))
->setActive(true)
->setCategory($this->getReference($r['category']));
$manager->persist($activityReason);
$reference = 'activity_reason_'.$r['name']['en'];
$reference = 'activity_reason_' . $r['name']['en'];
$this->addReference($reference, $activityReason);
static::$references[] = $reference;
}
$manager->flush();
}
}
@@ -1,35 +1,23 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
/**
* Description of LoadActivityReasonCategory
*
* @author Champs-Libres Coop
* Description of LoadActivityReasonCategory.
*/
class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface
{
@@ -37,27 +25,26 @@ class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtu
{
return 16200;
}
public function load(ObjectManager $manager)
{
$categs = [
['name' =>
['fr' => 'Logement', 'en' => 'Housing', 'nl' => 'Woning']],
['name' =>
['fr' => 'Démarches chômage', 'en' => 'Unemployment procedure', 'nl' => 'Werkloosheid werkwijze']],
['name' => ['fr' => 'Logement', 'en' => 'Housing', 'nl' => 'Woning']],
['name' => ['fr' => 'Démarches chômage', 'en' => 'Unemployment procedure', 'nl' => 'Werkloosheid werkwijze']],
];
foreach ($categs as $c) {
print "Creating activity reason category : " . $c['name']['en'] . "\n";
echo 'Creating activity reason category : ' . $c['name']['en'] . "\n";
$activityReasonCategory = (new ActivityReasonCategory())
->setName(($c['name']))
->setActive(true);
$manager->persist($activityReasonCategory);
$this->addReference(
'cat_'.$c['name']['en'],
$activityReasonCategory);
'cat_' . $c['name']['en'],
$activityReasonCategory
);
}
$manager->flush();
}
}
@@ -1,86 +1,67 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityType;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\ActivityBundle\Entity\ActivityType;
/**
* Description of LoadActivityType
*
* @author Champs-Libres Coop
* Description of LoadActivityType.
*/
class LoadActivityType extends Fixture implements OrderedFixtureInterface
{
public static $references = [];
public function getOrder()
{
return 16100;
}
public static $references = array();
public function load(ObjectManager $manager)
{
$types = [
# Exange
// Exange
[
'name' =>
['fr' => 'Entretien physique avec l\'usager'],
'category' => 'exchange' ],
'name' => ['fr' => 'Entretien physique avec l\'usager'],
'category' => 'exchange', ],
[
'name' =>
['fr' => 'Appel téléphonique', 'en' => 'Telephone call', 'nl' => 'Telefoon appel'],
'category' => 'exchange' ],
'name' => ['fr' => 'Appel téléphonique', 'en' => 'Telephone call', 'nl' => 'Telefoon appel'],
'category' => 'exchange', ],
[
'name' =>
['fr' => 'Courriel', 'en' => 'Email', 'nl' => 'Email'],
'category' => 'exchange' ],
# Meeting
'name' => ['fr' => 'Courriel', 'en' => 'Email', 'nl' => 'Email'],
'category' => 'exchange', ],
// Meeting
[
'name' =>
['fr' => 'Point technique encadrant'],
'category' => 'meeting' ],
'name' => ['fr' => 'Point technique encadrant'],
'category' => 'meeting', ],
[
'name' =>
['fr' => 'Réunion avec des partenaires'],
'category' => 'meeting' ],
'name' => ['fr' => 'Réunion avec des partenaires'],
'category' => 'meeting', ],
[
'name' =>
['fr' => 'Commission pluridisciplinaire et pluri-institutionnelle'],
'category' => 'meeting' ],
'name' => ['fr' => 'Commission pluridisciplinaire et pluri-institutionnelle'],
'category' => 'meeting', ],
];
foreach ($types as $t) {
print "Creating activity type : " . $t['name']['fr'] . " (cat:". $t['category'] . " \n";
echo 'Creating activity type : ' . $t['name']['fr'] . ' (cat:' . $t['category'] . " \n";
$activityType = (new ActivityType())
->setName(($t['name']))
->setCategory($this->getReference('activity_type_cat_'.$t['category']))
->setCategory($this->getReference('activity_type_cat_' . $t['category']))
->setSocialIssuesVisible(1)
->setSocialActionsVisible(1);
$manager->persist($activityType);
$reference = 'activity_type_'.$t['name']['fr'];
$reference = 'activity_type_' . $t['name']['fr'];
$this->addReference($reference, $activityType);
static::$references[] = $reference;
}
@@ -1,40 +1,27 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
/**
* Fixtures for ActivityTypeCategory
*
* @author Champs-Libres Coop
* Fixtures for ActivityTypeCategory.
*/
class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterface
{
public static $references = array();
public static $references = [];
public function getOrder()
{
@@ -55,13 +42,13 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac
];
foreach ($categories as $cat) {
print "Creating activity type category : " . $cat['ref'] . "\n";
echo 'Creating activity type category : ' . $cat['ref'] . "\n";
$newCat = (new ActivityTypeCategory())
->setName(($cat['name']));
$manager->persist($newCat);
$reference = 'activity_type_cat_'.$cat['ref'];
$reference = 'activity_type_cat_' . $cat['ref'];
$this->addReference($reference, $newCat);
static::$references[] = $reference;
@@ -1,37 +1,30 @@
<?php
/*
* Copyright (C) 2015 Julien Fastré <julien.fastre@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup;
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
use Chill\MainBundle\Entity\RoleScope;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup;
use Chill\MainBundle\Entity\RoleScope;
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use function in_array;
/**
* Add a role CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE for all groups except administrative,
* and a role CHILL_ACTIVITY_SEE for administrative
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
* and a role CHILL_ACTIVITY_SEE for administrative.
*/
class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface
{
@@ -40,12 +33,12 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac
return 16000;
}
public function load(ObjectManager $manager)
{
foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) {
$permissionsGroup = $this->getReference($permissionsGroupRef);
foreach (LoadScopes::$references as $scopeRef){
foreach (LoadScopes::$references as $scopeRef) {
$scope = $this->getReference($scopeRef);
//create permission group
switch ($permissionsGroup->getName()) {
@@ -53,47 +46,52 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac
if ($scope->getName()['en'] === 'administrative') {
break 2; // we do not want any power on administrative
}
break;
case 'administrative':
case 'direction':
if (in_array($scope->getName()['en'], array('administrative', 'social'))) {
if (in_array($scope->getName()['en'], ['administrative', 'social'], true)) {
break 2; // we do not want any power on social or administrative
}
}
break;
}
printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE & CHILL_ACTIVITY_DELETE, and stats and list permissions to %s "
. "permission group, scope '%s' \n",
$permissionsGroup->getName(), $scope->getName()['en']);
printf(
'Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE & CHILL_ACTIVITY_DELETE, and stats and list permissions to %s '
. "permission group, scope '%s' \n",
$permissionsGroup->getName(),
$scope->getName()['en']
);
$roleScopeUpdate = (new RoleScope())
->setRole('CHILL_ACTIVITY_UPDATE')
->setScope($scope);
->setRole('CHILL_ACTIVITY_UPDATE')
->setScope($scope);
$permissionsGroup->addRoleScope($roleScopeUpdate);
$roleScopeCreate = (new RoleScope())
->setRole('CHILL_ACTIVITY_CREATE')
->setScope($scope);
->setRole(ActivityVoter::CREATE_ACCOMPANYING_COURSE)
->setScope($scope);
$roleScopeCreate = (new RoleScope())
->setRole(ActivityVoter::CREATE_PERSON)
->setScope($scope);
$permissionsGroup->addRoleScope($roleScopeCreate);
$roleScopeDelete = (new RoleScope())
->setRole('CHILL_ACTIVITY_DELETE')
->setScope($scope);
->setRole('CHILL_ACTIVITY_DELETE')
->setScope($scope);
$permissionsGroup->addRoleScope($roleScopeDelete);
$roleScopeList = (new RoleScope())
->setRole(ActivityStatsVoter::LISTS)
;
->setRole(ActivityStatsVoter::LISTS);
$permissionsGroup->addRoleScope($roleScopeList);
$roleScopeStat = (new RoleScope())
->setRole(ActivityStatsVoter::STATS)
;
->setRole(ActivityStatsVoter::STATS);
$permissionsGroup->addRoleScope($roleScopeStat);
$manager->persist($roleScopeUpdate);
$manager->persist($roleScopeCreate);
$manager->persist($roleScopeDelete);
}
}
$manager->flush();
}
}
@@ -1,45 +1,30 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* This is the class that loads and manages your bundle configuration
* This is the class that loads and manages your bundle configuration.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class ChillActivityExtension extends Extension implements PrependExtensionInterface
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
@@ -47,7 +32,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
$container->setParameter('chill_activity.form.time_duration', $config['form']['time_duration']);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../config'));
$loader->load('services.yaml');
$loader->load('services/export.yaml');
$loader->load('services/repositories.yaml');
@@ -56,6 +41,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
$loader->load('services/form.yaml');
$loader->load('services/templating.yaml');
$loader->load('services/accompanyingPeriodConsistency.yaml');
$loader->load('services/doctrine.entitylistener.yaml');
}
public function prepend(ContainerBuilder $container)
@@ -65,31 +51,38 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
$this->prependCruds($container);
}
/* (non-PHPdoc)
public function prependAuthorization(ContainerBuilder $container)
{
$container->prependExtensionConfig('security', [
'role_hierarchy' => [
ActivityVoter::UPDATE => [ActivityVoter::SEE_DETAILS],
ActivityVoter::CREATE_PERSON => [ActivityVoter::SEE_DETAILS],
ActivityVoter::CREATE_ACCOMPANYING_COURSE => [ActivityVoter::SEE_DETAILS],
ActivityVoter::DELETE => [ActivityVoter::SEE_DETAILS],
ActivityVoter::SEE_DETAILS => [ActivityVoter::SEE],
ActivityVoter::FULL => [
ActivityVoter::CREATE_PERSON,
ActivityVoter::CREATE_ACCOMPANYING_COURSE,
ActivityVoter::DELETE,
ActivityVoter::UPDATE,
],
],
]);
}
/** (non-PHPdoc).
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
*/
public function prependRoutes(ContainerBuilder $container)
{
//add routes for custom bundle
$container->prependExtensionConfig('chill_main', array(
'routing' => array(
'resources' => array(
'@ChillActivityBundle/config/routes.yaml'
)
)
));
}
public function prependAuthorization(ContainerBuilder $container)
{
$container->prependExtensionConfig('security', array(
'role_hierarchy' => array(
ActivityVoter::UPDATE => array(ActivityVoter::SEE_DETAILS),
ActivityVoter::CREATE => array(ActivityVoter::SEE_DETAILS),
ActivityVoter::DELETE => array(ActivityVoter::SEE_DETAILS),
ActivityVoter::SEE_DETAILS => array(ActivityVoter::SEE)
)
));
$container->prependExtensionConfig('chill_main', [
'routing' => [
'resources' => [
'@ChillActivityBundle/config/routes.yaml',
],
],
]);
}
protected function prependCruds(ContainerBuilder $container)
@@ -105,17 +98,17 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
'actions' => [
'index' => [
'template' => '@ChillActivity/ActivityType/index.html.twig',
'role' => 'ROLE_ADMIN'
'role' => 'ROLE_ADMIN',
],
'new' => [
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityType/new.html.twig',
],
'edit' => [
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityType/edit.html.twig',
]
]
],
],
],
[
'class' => \Chill\ActivityBundle\Entity\ActivityTypeCategory::class,
@@ -126,17 +119,17 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
'actions' => [
'index' => [
'template' => '@ChillActivity/ActivityTypeCategory/index.html.twig',
'role' => 'ROLE_ADMIN'
'role' => 'ROLE_ADMIN',
],
'new' => [
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityTypeCategory/new.html.twig',
],
'edit' => [
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityTypeCategory/edit.html.twig',
]
]
],
],
],
[
'class' => \Chill\ActivityBundle\Entity\ActivityPresence::class,
@@ -147,19 +140,19 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
'actions' => [
'index' => [
'template' => '@ChillActivity/ActivityPresence/index.html.twig',
'role' => 'ROLE_ADMIN'
'role' => 'ROLE_ADMIN',
],
'new' => [
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityPresence/new.html.twig',
],
'edit' => [
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityPresence/edit.html.twig',
]
]
],
],
],
]
],
]);
}
}
@@ -1,71 +1,77 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use function is_int;
/**
* This is the class that validates and merges configuration from your app/config files
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('chill_activity');
$rootNode = $treeBuilder->getRootNode('chill_activity');
$rootNode
->children()
->arrayNode('form')
->canBeEnabled()
->children()
->arrayNode('time_duration')
->isRequired()
->requiresAtLeastOneElement()
->defaultValue(
array(
[ 'label' => '5 minutes', 'seconds' => 300],
[ 'label' => '10 minutes', 'seconds' => 600],
[ 'label' => '15 minutes', 'seconds' => 900],
[ 'label' => '20 minutes', 'seconds' => 1200],
[ 'label' => '25 minutes', 'seconds' => 1500],
[ 'label' => '30 minutes', 'seconds' => 1800],
[ 'label' => '45 minutes', 'seconds' => 2700],
[ 'label' => '1 hour', 'seconds' => 3600],
[ 'label' => '1 hour 15', 'seconds' => 4500],
[ 'label' => '1 hour 30', 'seconds' => 5400],
[ 'label' => '1 hour 45', 'seconds' => 6300],
[ 'label' => '2 hours', 'seconds' => 7200],
)
)
->info('The intervals of time to show in activity form')
->prototype('array')
->children()
->scalarNode('seconds')
->info("The number of seconds of this duration. Must be an integer.")
->cannotBeEmpty()
->validate()
->ifTrue(function($data) {
return !is_int($data);
})->thenInvalid("The value %s is not a valid integer")
->end()
->end()
->scalarNode('label')
->cannotBeEmpty()
->info("The label to show into fields")
->end()
->end()
->end()
->children()
->arrayNode('form')
->canBeEnabled()
->children()
->arrayNode('time_duration')
->isRequired()
->requiresAtLeastOneElement()
->defaultValue(
[
['label' => '5 minutes', 'seconds' => 300],
['label' => '10 minutes', 'seconds' => 600],
['label' => '15 minutes', 'seconds' => 900],
['label' => '20 minutes', 'seconds' => 1200],
['label' => '25 minutes', 'seconds' => 1500],
['label' => '30 minutes', 'seconds' => 1800],
['label' => '45 minutes', 'seconds' => 2700],
['label' => '1 hour', 'seconds' => 3600],
['label' => '1 hour 15', 'seconds' => 4500],
['label' => '1 hour 30', 'seconds' => 5400],
['label' => '1 hour 45', 'seconds' => 6300],
['label' => '2 hours', 'seconds' => 7200],
]
)
->info('The intervals of time to show in activity form')
->prototype('array')
->children()
->scalarNode('seconds')
->info('The number of seconds of this duration. Must be an integer.')
->cannotBeEmpty()
->validate()
->ifTrue(static function ($data) {
return !is_int($data);
})->thenInvalid('The value %s is not a valid integer')
->end()
->end()
->scalarNode('label')
->cannotBeEmpty()
->info('The label to show into fields')
->end()
->end()
->end()
// ->validate()
//
//
// ->ifTrue(function ($data) {
// // test this is an array
// if (!is_array($data)) {
@@ -84,11 +90,10 @@ class Configuration implements ConfigurationInterface
// })
// ->thenInvalid("The data are invalid. The keys must be a string and the value integers")
// ->end()
->end()
->end()
->end()
->end();
->end()
->end()
->end()
->end();
return $treeBuilder;
}
+394 -318
View File
@@ -1,137 +1,63 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Chill\DocStoreBundle\Entity\Document;
use Chill\ActivityBundle\Validator\Constraints as ActivityValidator;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasScopeInterface;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\ORM\Mapping as ORM;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Center;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasScopeInterface;
use Doctrine\Common\Collections\Collection;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
use Symfony\Component\Serializer\Annotation\Groups;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\SerializedName;
/**
* Class Activity
* Class Activity.
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity(repositoryClass="Chill\ActivityBundle\Repository\ActivityRepository")
* @ORM\Table(name="activity")
* @ORM\HasLifecycleCallbacks()
* @ORM\HasLifecycleCallbacks
* @DiscriminatorMap(typeProperty="type", mapping={
* "activity"=Activity::class
* })
* "activity": Activity::class
* })
* @ActivityValidator\ActivityValidity
*
* TODO see if necessary
* UserCircleConsistency(
* "CHILL_ACTIVITY_SEE_DETAILS",
* getUserFunction="getUser",
* path="scope")
*/
/*
* TODO : revoir
* @UserCircleConsistency(
* "CHILL_ACTIVITY_SEE_DETAILS",
* getUserFunction="getUser",
* path="scope")
*/
class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCenterInterface, HasScopeInterface
{
const SENTRECEIVED_SENT = 'sent';
const SENTRECEIVED_RECEIVED = 'received';
public const SENTRECEIVED_RECEIVED = 'received';
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"read"})
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
private User $user;
/**
* @ORM\Column(type="datetime")
*/
private \DateTime $date;
/**
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTime $durationTime = null;
/**
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTime $travelTime = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
*/
private ?ActivityPresence $attendee = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
*/
private Collection $reasons;
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
* @Groups({"read"})
*/
private Collection $socialIssues;
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
* @Groups({"read"})
*/
private Collection $socialActions;
/**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
*/
private ActivityType $type;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
*/
private ?Scope $scope = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?Person $person = null;
public const SENTRECEIVED_SENT = 'sent';
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
@@ -139,44 +65,128 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
*/
private ?AccompanyingPeriod $accompanyingPeriod = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
* @Groups({"read", "docgen:read"})
* @SerializedName("activityType")
* @ORM\JoinColumn(name="type_id")
*/
private ActivityType $activityType;
/**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
* @Groups({"docgen:read"})
*/
private ?ActivityPresence $attendee = null;
/**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
* @Groups({"docgen:read"})
*/
private CommentEmbeddable $comment;
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
* @Groups({"read"})
* @ORM\Column(type="datetime")
* @Groups({"docgen:read"})
*/
private ?Collection $persons = null;
private DateTime $date;
/**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
* @Groups({"read"})
*/
private ?Collection $thirdParties = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject")
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
*/
private Collection $documents;
/**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
* @Groups({"read"})
* @ORM\Column(type="time", nullable=true)
*/
private ?Collection $users = null;
private ?DateTime $durationTime = null;
/**
* @ORM\Column(type="boolean", options={"default"=false})
* @ORM\Column(type="boolean", options={"default": false})
* @Groups({"docgen:read"})
*/
private bool $emergency = false;
/**
* @ORM\Column(type="string", options={"default"=""})
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"read", "docgen:read"})
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
* @groups({"read", "docgen:read"})
*/
private ?Location $location = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?Person $person = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
* @Groups({"read", "docgen:read"})
*/
private ?Collection $persons = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
* @Groups({"docgen:read"})
*/
private Collection $reasons;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
* @Groups({"docgen:read"})
*/
private ?Scope $scope = null;
/**
* @ORM\Column(type="string", options={"default": ""})
* @Groups({"docgen:read"})
*/
private string $sentReceived = '';
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
* @Groups({"read", "docgen:read"})
*/
private Collection $socialActions;
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
* @Groups({"read", "docgen:read"})
*/
private Collection $socialIssues;
/**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
* @Groups({"read", "docgen:read"})
*/
private ?Collection $thirdParties = null;
/**
* @ORM\Column(type="time", nullable=true)
*/
private ?DateTime $travelTime = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
* @Groups({"docgen:read"})
*/
private User $user;
/**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
* @Groups({"read", "docgen:read"})
*/
private ?Collection $users = null;
public function __construct()
{
$this->reasons = new ArrayCollection();
@@ -189,71 +199,27 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
$this->socialActions = new ArrayCollection();
}
public function getId(): ?int
public function addDocument(StoredObject $document): self
{
return $this->id;
}
public function setUser(User $user): self
{
$this->user = $user;
$this->documents[] = $document;
return $this;
}
public function getUser(): User
/**
* Add a person to the person list.
*/
public function addPerson(?Person $person): self
{
return $this->user;
}
public function setDate(\DateTime $date): self
{
$this->date = $date;
if (null !== $person) {
if (!$this->persons->contains($person)) {
$this->persons[] = $person;
}
}
return $this;
}
public function getDate(): \DateTime
{
return $this->date;
}
public function setDurationTime(?\DateTime $durationTime): self
{
$this->durationTime = $durationTime;
return $this;
}
public function getDurationTime(): ?\DateTime
{
return $this->durationTime;
}
public function setTravelTime(\DateTime $travelTime): self
{
$this->travelTime = $travelTime;
return $this;
}
public function getTravelTime(): ?\DateTime
{
return $this->travelTime;
}
public function setAttendee(ActivityPresence $attendee): self
{
$this->attendee = $attendee;
return $this;
}
public function getAttendee(): ?ActivityPresence
{
return $this->attendee;
}
public function addReason(ActivityReason $reason): self
{
$this->reasons->add($reason);
@@ -261,49 +227,6 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
return $this;
}
public function removeReason(ActivityReason $reason): void
{
$this->reasons->removeElement($reason);
}
public function getReasons(): Collection
{
return $this->reasons;
}
public function setReasons(?ArrayCollection $reasons): self
{
$this->reasons = $reasons;
return $this;
}
public function getSocialIssues(): Collection
{
return $this->socialIssues;
}
public function addSocialIssue(SocialIssue $socialIssue): self
{
if (!$this->socialIssues->contains($socialIssue)) {
$this->socialIssues[] = $socialIssue;
}
return $this;
}
public function removeSocialIssue(SocialIssue $socialIssue): self
{
$this->socialIssues->removeElement($socialIssue);
return $this;
}
public function getSocialActions(): Collection
{
return $this->socialActions;
}
public function addSocialAction(SocialAction $socialAction): self
{
if (!$this->socialActions->contains($socialAction)) {
@@ -313,67 +236,55 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
return $this;
}
public function removeSocialAction(SocialAction $socialAction): self
public function addSocialIssue(SocialIssue $socialIssue): self
{
$this->socialActions->removeElement($socialAction);
if (!$this->socialIssues->contains($socialIssue)) {
$this->socialIssues[] = $socialIssue;
}
return $this;
}
public function setType(ActivityType $type): self
public function addThirdParty(?ThirdParty $thirdParty): self
{
$this->type = $type;
if (null !== $thirdParty) {
if (!$this->thirdParties->contains($thirdParty)) {
$this->thirdParties[] = $thirdParty;
}
}
return $this;
}
public function getType(): ActivityType
public function addUser(?User $user): self
{
return $this->type;
}
public function setScope(Scope $scope): self
{
$this->scope = $scope;
if (null !== $user) {
if (!$this->users->contains($user)) {
$this->users[] = $user;
}
}
return $this;
}
public function getScope(): ?Scope
{
return $this->scope;
}
public function setPerson(?Person $person): self
{
$this->person = $person;
return $this;
}
public function getPerson(): ?Person
{
return $this->person;
}
public function getAccompanyingPeriod(): ?AccompanyingPeriod
{
return $this->accompanyingPeriod;
}
public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self
public function getActivityType(): ActivityType
{
$this->accompanyingPeriod = $accompanyingPeriod;
return $this->activityType;
}
return $this;
public function getAttendee(): ?ActivityPresence
{
return $this->attendee;
}
/**
* get the center
* center is extracted from person
* center is extracted from person.
*/
public function getCenter(): ?Center
{
@@ -389,28 +300,51 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
return $this->comment;
}
public function setComment(CommentEmbeddable $comment): self
public function getDate(): DateTime
{
$this->comment = $comment;
return $this->date;
}
return $this;
public function getDocuments(): Collection
{
return $this->documents;
}
/**
* Add a person to the person list
* @Groups({"docgen:read"})
*/
public function addPerson(?Person $person): self
public function getDurationMinute(): int
{
if (null !== $person) {
$this->persons[] = $person;
if (null === $this->durationTime) {
return 0;
}
return $this;
return (int) round(($this->durationTime->getTimestamp() + $this->durationTime->getOffset()) / 60.0, 0);
}
public function removePerson(Person $person): void
public function getDurationTime(): ?DateTime
{
$this->persons->removeElement($person);
return $this->durationTime;
}
public function getEmergency(): bool
{
return $this->emergency;
}
public function getId(): ?int
{
return $this->id;
}
public function getLocation(): ?Location
{
return $this->location;
}
public function getPerson(): ?Person
{
return $this->person;
}
public function getPersons(): Collection
@@ -422,13 +356,16 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
{
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();
}
}
return $personsAssociated;
}
return [];
}
@@ -436,28 +373,116 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
{
if (null !== $this->accompanyingPeriod) {
$personsNotAssociated = [];
// TODO better semantic with: return $this->persons->filter(...);
foreach ($this->persons as $person) {
if (!in_array($person, $this->getPersonsAssociated())) {
$personsNotAssociated[] = $person;
if ($this->accompanyingPeriod->getOpenParticipationContainsPerson($person) === null) {
$personsNotAssociated[] = $person;
}
}
return $personsNotAssociated;
}
return [];
}
public function setPersons(?Collection $persons): self
public function getReasons(): Collection
{
$this->persons = $persons;
return $this->reasons;
}
public function getScope(): ?Scope
{
return $this->scope;
}
public function getSentReceived(): string
{
return $this->sentReceived;
}
public function getSocialActions(): Collection
{
return $this->socialActions;
}
public function getSocialIssues(): Collection
{
return $this->socialIssues;
}
public function getThirdParties(): Collection
{
return $this->thirdParties;
}
public function getTravelTime(): ?DateTime
{
return $this->travelTime;
}
/**
* @Groups({"docgen:read"})
*/
public function getTravelTimeMinute(): int
{
if (null === $this->travelTime) {
return 0;
}
return (int) round(($this->travelTime->getTimestamp() + $this->travelTime->getOffset()) / 60.0, 0);
}
/**
* @deprecated
*/
public function getType(): ActivityType
{
return $this->activityType;
}
public function getUser(): User
{
return $this->user;
}
public function getUsers(): Collection
{
return $this->users;
}
public function isEmergency(): bool
{
return $this->getEmergency();
}
public function removeDocument(StoredObject $document): void
{
$this->documents->removeElement($document);
}
public function removePerson(Person $person): void
{
$this->persons->removeElement($person);
}
public function removeReason(ActivityReason $reason): void
{
$this->reasons->removeElement($reason);
}
public function removeSocialAction(SocialAction $socialAction): self
{
$this->socialActions->removeElement($socialAction);
return $this;
}
public function addThirdParty(?ThirdParty $thirdParty): self
public function removeSocialIssue(SocialIssue $socialIssue): self
{
if (null !== $thirdParty) {
$this->thirdParties[] = $thirdParty;
}
$this->socialIssues->removeElement($socialIssue);
return $this;
}
@@ -466,33 +491,44 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
$this->thirdParties->removeElement($thirdParty);
}
public function getThirdParties(): Collection
public function removeUser(User $user): void
{
return $this->thirdParties;
$this->users->removeElement($user);
}
public function setThirdParties(?Collection $thirdParties): self
public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self
{
$this->thirdParties = $thirdParties;
$this->accompanyingPeriod = $accompanyingPeriod;
return $this;
}
public function addDocument(Document $document): self
public function setActivityType(ActivityType $activityType): self
{
$this->documents[] = $document;
$this->activityType = $activityType;
return $this;
}
public function removeDocument(Document $document): void
public function setAttendee(ActivityPresence $attendee): self
{
$this->documents->removeElement($document);
$this->attendee = $attendee;
return $this;
}
public function getDocuments(): Collection
public function setComment(CommentEmbeddable $comment): self
{
return $this->documents;
$this->comment = $comment;
return $this;
}
public function setDate(DateTime $date): self
{
$this->date = $date;
return $this;
}
public function setDocuments(Collection $documents): self
@@ -502,41 +538,13 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
return $this;
}
public function addUser(?User $user): self
public function setDurationTime(?DateTime $durationTime): self
{
if (null !== $user) {
$this->users[] = $user;
}
return $this;
}
public function removeUser(User $user): void
{
$this->users->removeElement($user);
}
public function getUsers(): Collection
{
return $this->users;
}
public function setUsers(?Collection $users): self
{
$this->users = $users;
$this->durationTime = $durationTime;
return $this;
}
public function isEmergency(): bool
{
return $this->getEmergency();
}
public function getEmergency(): bool
{
return $this->emergency;
}
public function setEmergency(bool $emergency): self
{
$this->emergency = $emergency;
@@ -544,9 +552,39 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
return $this;
}
public function getSentReceived(): string
public function setLocation(?Location $location): Activity
{
return $this->sentReceived;
$this->location = $location;
return $this;
}
public function setPerson(?Person $person): self
{
$this->person = $person;
return $this;
}
public function setPersons(?Collection $persons): self
{
$this->persons = $persons;
return $this;
}
public function setReasons(?ArrayCollection $reasons): self
{
$this->reasons = $reasons;
return $this;
}
public function setScope(Scope $scope): self
{
$this->scope = $scope;
return $this;
}
public function setSentReceived(?string $sentReceived): self
@@ -555,4 +593,42 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
return $this;
}
public function setThirdParties(?Collection $thirdParties): self
{
$this->thirdParties = $thirdParties;
return $this;
}
public function setTravelTime(DateTime $travelTime): self
{
$this->travelTime = $travelTime;
return $this;
}
/**
* @deprecated
*/
public function setType(ActivityType $activityType): self
{
$this->activityType = $activityType;
return $this;
}
public function setUser(UserInterface $user): self
{
$this->user = $user;
return $this;
}
public function setUsers(?Collection $users): self
{
$this->users = $users;
return $this;
}
}
@@ -1,70 +1,47 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* Class ActivityPresence
* Class ActivityPresence.
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity()
* @ORM\Entity
* @ORM\Table(name="activitytpresence")
* @ORM\HasLifecycleCallbacks()
* @ORM\HasLifecycleCallbacks
*/
class ActivityPresence
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id;
/**
* @ORM\Column(type="json")
*/
private array $name = [];
/**
* @ORM\Column(type="boolean")
*/
private bool $active = true;
public function getId(): int
{
return $this->id;
}
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Serializer\Groups({"docgen:read"})
*/
private ?int $id;
public function setName(array $name): self
{
$this->name = $name;
return $this;
}
public function getName(): array
{
return $this->name;
}
/**
* @ORM\Column(type="json")
* @Serializer\Groups({"docgen:read"})
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
private array $name = [];
/**
* Get active
@@ -75,9 +52,19 @@ class ActivityPresence
return $this->active;
}
public function getId(): int
{
return $this->id;
}
public function getName(): array
{
return $this->name;
}
/**
* Is active
* return true if the category type is active
* return true if the category type is active.
*/
public function isActive(): bool
{
@@ -86,7 +73,7 @@ class ActivityPresence
/**
* Set active
* set to true if the category type is active
* set to true if the category type is active.
*/
public function setActive(bool $active): self
{
@@ -94,4 +81,11 @@ class ActivityPresence
return $this;
}
public function setName(array $name): self
{
$this->name = $name;
return $this;
}
}
@@ -1,40 +1,43 @@
<?php
/*
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
/**
* Class ActivityReason
* Class ActivityReason.
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity()
* @ORM\Entity
* @ORM\Table(name="activityreason")
* @ORM\HasLifecycleCallbacks()
* @ORM\HasLifecycleCallbacks
*/
class ActivityReason
{
/**
* @var integer
* @var bool
* @ORM\Column(type="boolean")
*/
private $active = true;
/**
* @var ActivityReasonCategory
* @ORM\ManyToOne(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
* inversedBy="reasons")
*/
private $category;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
@@ -44,91 +47,22 @@ class ActivityReason
/**
* @var array
* @ORM\Column(type="json_array")
* @ORM\Column(type="json")
*/
private $name;
/**
* @var ActivityReasonCategory
* @ORM\ManyToOne(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
* inversedBy="reasons")
*/
private $category;
/**
* @var boolean
* @ORM\Column(type="boolean")
*/
private $active = true;
/**
* Get id
* Get active.
*
* @return integer
* @return bool
*/
public function getId()
public function getActive()
{
return $this->id;
return $this->active;
}
/**
* Set name
*
* @param array $name
* @return ActivityReason
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return array | string
*/
public function getName($locale = null)
{
if ($locale) {
if (isset($this->name[$locale])) {
return $this->name[$locale];
} else {
foreach ($this->name as $name) {
if (!empty($name)) {
return $name;
}
}
}
return '';
} else {
return $this->name;
}
}
/**
* Set category of the reason. If you set to the reason an inactive
* category, the reason will become inactive
*
* @param ActivityReasonCategory $category
* @return ActivityReason
*/
public function setCategory(ActivityReasonCategory $category)
{
if($this->category !== $category && ! $category->getActive()) {
$this->setActive(False);
}
$this->category = $category;
return $this;
}
/**
* Get category
* Get category.
*
* @return ActivityReasonCategory
*/
@@ -138,9 +72,46 @@ class ActivityReason
}
/**
* Set active
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Get name.
*
* @param mixed|null $locale
*
* @return array | string
*/
public function getName($locale = null)
{
if ($locale) {
if (isset($this->name[$locale])) {
return $this->name[$locale];
}
foreach ($this->name as $name) {
if (!empty($name)) {
return $name;
}
}
return '';
}
return $this->name;
}
/**
* Set active.
*
* @param bool $active
*
* @param boolean $active
* @return ActivityReason
*/
public function setActive($active)
@@ -151,13 +122,33 @@ class ActivityReason
}
/**
* Get active
* Set category of the reason. If you set to the reason an inactive
* category, the reason will become inactive.
*
* @return boolean
* @return ActivityReason
*/
public function getActive()
public function setCategory(ActivityReasonCategory $category)
{
return $this->active;
if ($this->category !== $category && !$category->getActive()) {
$this->setActive(false);
}
$this->category = $category;
return $this;
}
/**
* Set name.
*
* @param array $name
*
* @return ActivityReason
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
}
@@ -1,39 +1,36 @@
<?php
/*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Class ActivityReasonCategory
* Class ActivityReasonCategory.
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity()
* @ORM\Entity
* @ORM\Table(name="activityreasoncategory")
* @ORM\HasLifecycleCallbacks()
* @ORM\HasLifecycleCallbacks
*/
class ActivityReasonCategory
{
/**
* @var integer
* @var bool
* @ORM\Column(type="boolean")
*/
private $active = true;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
@@ -43,25 +40,20 @@ class ActivityReasonCategory
/**
* @var string
* @ORM\Column(type="json_array")
* @ORM\Column(type="json")
*/
private $name;
/**
* @var boolean
* @ORM\Column(type="boolean")
*/
private $active = true;
/**
* Array of ActivityReason
* Array of ActivityReason.
*
* @var ArrayCollection
* @ORM\OneToMany(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReason",
* mappedBy="category")
* mappedBy="category")
*/
private $reasons;
/**
* ActivityReasonCategory constructor.
*/
@@ -69,19 +61,29 @@ class ActivityReasonCategory
{
$this->reasons = new ArrayCollection();
}
/**
* @return string
*/
public function __toString()
{
return 'ActivityReasonCategory('.$this->getName('x').')';
return 'ActivityReasonCategory(' . $this->getName('x') . ')';
}
/**
* Get id
* Get active.
*
* @return integer
* @return bool
*/
public function getActive()
{
return $this->active;
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
@@ -89,20 +91,9 @@ class ActivityReasonCategory
}
/**
* Set name
* Get name.
*
* @param array $name
* @return ActivityReasonCategory
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
* @param mixed|null $locale
*
* @return array
*/
@@ -111,48 +102,53 @@ class ActivityReasonCategory
if ($locale) {
if (isset($this->name[$locale])) {
return $this->name[$locale];
} else {
foreach ($this->name as $name) {
if (!empty($name)) {
return $name;
}
}
foreach ($this->name as $name) {
if (!empty($name)) {
return $name;
}
}
return '';
} else {
return $this->name;
}
return $this->name;
}
/**
* Declare a category as active (or not). When a category is set
* as unactive, all the reason have this entity as category is also
* set as unactive
* set as unactive.
*
* @param bool $active
*
* @param boolean $active
* @return ActivityReasonCategory
*/
public function setActive($active)
{
if($this->active !== $active && !$active) {
if ($this->active !== $active && !$active) {
foreach ($this->reasons as $reason) {
$reason->setActive($active);
}
}
$this->active = $active;
return $this;
}
/**
* Get active
* Set name.
*
* @return boolean
* @param array $name
*
* @return ActivityReasonCategory
*/
public function getActive()
public function setName($name)
{
return $this->active;
$this->name = $name;
return $this;
}
}
File diff suppressed because it is too large Load Diff
@@ -1,85 +1,47 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class ActivityTypeCateogry
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity()
* @ORM\Entity
* @ORM\Table(name="activitytypecategory")
* @ORM\HasLifecycleCallbacks()
* @ORM\HasLifecycleCallbacks
*/
class ActivityTypeCategory
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id;
/**
* @ORM\Column(type="json_array")
*/
private array $name = [];
/**
* @ORM\Column(type="boolean")
*/
private bool $active = true;
/**
* @ORM\Column(type="float", options={"default"="0.0"})
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
/**
* @ORM\Column(type="json")
*/
private array $name = [];
/**
* @ORM\Column(type="float", options={"default": "0.0"})
*/
private float $ordering = 0.0;
/**
* Get id
*/
public function getId(): int
{
return $this->id;
}
/**
* Set name
*/
public function setName(array $name): self
{
$this->name = $name;
return $this;
}
/**
* Get name
*/
public function getName(): array
{
return $this->name;
}
/**
* Get active
* return true if the category type is active.
@@ -89,9 +51,27 @@ class ActivityTypeCategory
return $this->active;
}
public function getId(): ?int
{
return $this->id;
}
/**
* Get name.
*/
public function getName(): array
{
return $this->name;
}
public function getOrdering(): float
{
return $this->ordering;
}
/**
* Is active
* return true if the category type is active
* return true if the category type is active.
*/
public function isActive(): bool
{
@@ -100,7 +80,7 @@ class ActivityTypeCategory
/**
* Set active
* set to true if the category type is active
* set to true if the category type is active.
*/
public function setActive(bool $active): self
{
@@ -109,9 +89,14 @@ class ActivityTypeCategory
return $this;
}
public function getOrdering(): float
/**
* Set name.
*/
public function setName(array $name): self
{
return $this->ordering;
$this->name = $name;
return $this;
}
public function setOrdering(float $ordering): self
@@ -0,0 +1,77 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\EntityListener;
use Chill\ActivityBundle\Entity\Activity;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
use DateTimeImmutable;
use Doctrine\ORM\EntityManagerInterface;
use function in_array;
class ActivityEntityListener
{
private EntityManagerInterface $em;
private AccompanyingPeriodWorkRepository $workRepository;
public function __construct(EntityManagerInterface $em, AccompanyingPeriodWorkRepository $workRepository)
{
$this->em = $em;
$this->workRepository = $workRepository;
}
public function persistActionToCourse(Activity $activity)
{
if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
$period = $activity->getAccompanyingPeriod();
$accompanyingCourseWorks = $this->workRepository->findByAccompanyingPeriod($period);
$periodActions = [];
$now = new DateTimeImmutable();
foreach ($accompanyingCourseWorks as $key => $work) {
// take only the actions which are still opened
if ($work->getEndDate() === null || $work->getEndDate() > ($activity->getDate() ?? $now)) {
$periodActions[$key] = spl_object_hash($work->getSocialAction());
}
}
$associatedPersons = $activity->getPersonsAssociated();
$associatedThirdparties = $activity->getThirdParties();
foreach ($activity->getSocialActions() as $action) {
if (in_array(spl_object_hash($action), $periodActions, true)) {
continue;
}
$newAction = new AccompanyingPeriodWork();
$newAction->setSocialAction($action);
$period->addWork($newAction);
$date = DateTimeImmutable::createFromMutable($activity->getDate());
$newAction->setStartDate($date);
foreach ($associatedPersons as $person) {
$newAction->addPerson($person);
}
foreach ($associatedThirdparties as $thirdparty) {
$newAction->setHandlingThierparty($thirdparty);
}
$this->em->persist($newAction);
$this->em->flush();
}
}
}
}
@@ -1,107 +1,93 @@
<?php
/*
* Copyright (C) 2016 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\AggregatorInterface;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository;
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr\Join;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use RuntimeException;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityReasonAggregator implements AggregatorInterface,
ExportElementValidatedInterface
use function array_key_exists;
use function count;
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
{
/**
*
* @var EntityRepository
*/
protected $categoryRepository;
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository;
/**
*
* @var EntityRepository
*/
protected $reasonRepository;
protected ActivityReasonRepository $activityReasonRepository;
/**
*
* @var TranslatableStringHelper
*/
protected $stringHelper;
protected TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
EntityRepository $categoryRepository,
EntityRepository $reasonRepository,
TranslatableStringHelper $stringHelper
ActivityReasonCategoryRepository $activityReasonCategoryRepository,
ActivityReasonRepository $activityReasonRepository,
TranslatableStringHelper $translatableStringHelper
) {
$this->categoryRepository = $categoryRepository;
$this->reasonRepository = $reasonRepository;
$this->stringHelper = $stringHelper;
$this->activityReasonCategoryRepository = $activityReasonCategoryRepository;
$this->activityReasonRepository = $activityReasonRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
if ($data['level'] === 'reasons') {
if ('reasons' === $data['level']) {
$elem = 'reasons.id';
$alias = 'activity_reasons_id';
} elseif ($data['level'] === 'categories') {
} elseif ('categories' === $data['level']) {
$elem = 'category.id';
$alias = 'activity_categories_id';
} else {
throw new \RuntimeException('the data provided are not recognized');
throw new RuntimeException('The data provided are not recognized.');
}
$qb->addSelect($elem.' as '.$alias);
$qb->addSelect($elem . ' as ' . $alias);
// make a jointure only if needed
$join = $qb->getDQLPart('join');
if (
(array_key_exists('activity', $join)
&&
!$this->checkJoinAlreadyDefined($join['activity'], 'reasons')
(
array_key_exists('activity', $join)
&& !$this->checkJoinAlreadyDefined($join['activity'], 'reasons')
)
OR
(! array_key_exists('activity', $join))
|| (!array_key_exists('activity', $join))
) {
$qb->add(
'join',
array('activity' =>
new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')
),
true);
'join',
[
'activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons'),
],
true
);
}
// join category if necessary
if ($alias === 'activity_categories_id') {
if ('activity_categories_id' === $alias) {
// add join only if needed
if (!$this->checkJoinAlreadyDefined($qb->getDQLPart('join')['activity'], 'category')) {
$qb->join('reasons.category', 'category');
@@ -118,12 +104,104 @@ class ActivityReasonAggregator implements AggregatorInterface,
}
}
public function applyOn()
{
return 'activity';
}
public function buildForm(FormBuilderInterface $builder)
{
$builder->add(
'level',
ChoiceType::class,
[
'choices' => [
'By reason' => 'reasons',
'By category of reason' => 'categories',
],
'multiple' => false,
'expanded' => true,
'label' => "Reason's level",
]
);
}
public function getLabels($key, array $values, $data)
{
// for performance reason, we load data from db only once
switch ($data['level']) {
case 'reasons':
$this->activityReasonRepository->findBy(['id' => $values]);
break;
case 'categories':
$this->activityReasonCategoryRepository->findBy(['id' => $values]);
break;
default:
throw new RuntimeException(sprintf("The level data '%s' is invalid.", $data['level']));
}
return function ($value) use ($data) {
if ('_header' === $value) {
return 'reasons' === $data['level'] ? 'Group by reasons' : 'Group by categories of reason';
}
switch ($data['level']) {
case 'reasons':
$r = $this->activityReasonRepository->find($value);
return sprintf(
'%s > %s',
$this->translatableStringHelper->localize($r->getCategory()->getName()),
$this->translatableStringHelper->localize($r->getName())
);
case 'categories':
$c = $this->activityReasonCategoryRepository->find($value);
return $this->translatableStringHelper->localize($c->getName());
}
};
}
public function getQueryKeys($data)
{
// add select element
if ('reasons' === $data['level']) {
return ['activity_reasons_id'];
}
if ('categories' === $data['level']) {
return ['activity_categories_id'];
}
throw new RuntimeException('The data provided are not recognised.');
}
public function getTitle()
{
return 'Aggregate by activity reason';
}
public function validateForm($data, ExecutionContextInterface $context)
{
if (null === $data['level']) {
$context
->buildViolation("The reasons's level should not be empty.")
->addViolation();
}
}
/**
* Check if a join between Activity and another alias
* Check if a join between Activity and another alias.
*
* @param Join[] $joins
* @param string $alias the alias to search for
* @return boolean
*
* @return bool
*/
private function checkJoinAlreadyDefined(array $joins, $alias)
{
@@ -135,99 +213,4 @@ class ActivityReasonAggregator implements AggregatorInterface,
return false;
}
public function applyOn()
{
return 'activity';
}
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('level', ChoiceType::class, array(
'choices' => array(
'By reason' => 'reasons',
'By category of reason' => 'categories'
),
'multiple' => false,
'expanded' => true,
'label' => 'Reason\'s level'
));
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['level'] === null) {
$context->buildViolation("The reasons's level should not be empty")
->addViolation();
}
}
public function getTitle()
{
return "Aggregate by activity reason";
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function getLabels($key, array $values, $data)
{
// for performance reason, we load data from db only once
switch ($data['level']) {
case 'reasons':
$this->reasonRepository->findBy(array('id' => $values));
break;
case 'categories':
$this->categoryRepository->findBy(array('id' => $values));
break;
default:
throw new \RuntimeException(sprintf("the level data '%s' is invalid",
$data['level']));
}
return function($value) use ($data) {
if ($value === '_header') {
return $data['level'] === 'reasons' ?
'Group by reasons'
:
'Group by categories of reason'
;
}
switch ($data['level']) {
case 'reasons':
/* @var $r \Chill\ActivityBundle\Entity\ActivityReason */
$r = $this->reasonRepository->find($value);
return $this->stringHelper->localize($r->getCategory()->getName())
." > "
. $this->stringHelper->localize($r->getName());
;
break;
case 'categories':
$c = $this->categoryRepository->find($value);
return $this->stringHelper->localize($c->getName());
break;
// no need for a default : the default was already set above
}
};
}
public function getQueryKeys($data)
{
// add select element
if ($data['level'] === 'reasons') {
return array('activity_reasons_id');
} elseif ($data['level'] === 'categories') {
return array ('activity_categories_id');
} else {
throw new \RuntimeException('the data provided are not recognised');
}
}
}
@@ -1,88 +1,54 @@
<?php
/*
* Copyright (C) 2016 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\AggregatorInterface;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Closure;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityTypeAggregator implements AggregatorInterface
{
/**
*
* @var EntityRepository
*/
protected $typeRepository;
/**
*
* @var TranslatableStringHelper
*/
protected $stringHelper;
const KEY = 'activity_type_aggregator';
public const KEY = 'activity_type_aggregator';
protected ActivityTypeRepository $activityTypeRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
EntityRepository $typeRepository,
TranslatableStringHelper $stringHelper
ActivityTypeRepository $activityTypeRepository,
TranslatableStringHelperInterface $translatableStringHelper
) {
$this->typeRepository = $typeRepository;
$this->stringHelper = $stringHelper;
$this->activityTypeRepository = $activityTypeRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
// add select element
$qb->addSelect(sprintf('IDENTITY(activity.type) AS %s', self::KEY));
// add the "group by" part
$groupBy = $qb->addGroupBy(self::KEY);
}
/**
* Check if a join between Activity and another alias
*
* @param Join[] $joins
* @param string $alias the alias to search for
* @return boolean
*/
private function checkJoinAlreadyDefined(array $joins, $alias)
{
foreach ($joins as $join) {
if ($join->getAlias() === $alias) {
return true;
}
}
return false;
$qb->addGroupBy(self::KEY);
}
public function applyOn()
@@ -95,37 +61,48 @@ class ActivityTypeAggregator implements AggregatorInterface
// no form required for this aggregator
}
public function getTitle()
{
return "Aggregate by activity type";
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function getLabels($key, array $values, $data)
public function getLabels($key, array $values, $data): Closure
{
// for performance reason, we load data from db only once
$this->typeRepository->findBy(array('id' => $values));
return function($value) use ($data) {
if ($value === '_header') {
$this->activityTypeRepository->findBy(['id' => $values]);
return function ($value): string {
if ('_header' === $value) {
return 'Activity type';
}
/* @var $r \Chill\ActivityBundle\Entity\ActivityType */
$t = $this->typeRepository->find($value);
$t = $this->activityTypeRepository->find($value);
return $this->stringHelper->localize($t->getName());
return $this->translatableStringHelper->localize($t->getName());
};
}
public function getQueryKeys($data)
public function getQueryKeys($data): array
{
return array(self::KEY);
return [self::KEY];
}
public function getTitle()
{
return 'Aggregate by activity type';
}
/**
* Check if a join between Activity and another alias.
*
* @param Join[] $joins
* @param string $alias the alias to search for
*
* @return bool
*/
private function checkJoinAlreadyDefined(array $joins, $alias)
{
foreach ($joins as $join) {
if ($join->getAlias() === $alias) {
return true;
}
}
return false;
}
}
@@ -1,51 +1,36 @@
<?php
/*
* Copyright (C) 2019 Champs Libres Cooperative <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Export\Aggregator;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\AggregatorInterface;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\Query\Expr\Join;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityManagerInterface;
use Chill\MainBundle\Entity\User;
/**
*
* Chill is a software for social workers
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Repository\UserRepository;
use Closure;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
class ActivityUserAggregator implements AggregatorInterface
{
/**
*
* @var EntityManagerInterface
*/
protected $em;
const KEY = 'activity_user_id';
function __construct(EntityManagerInterface $em)
{
$this->em = $em;
public const KEY = 'activity_user_id';
private UserRepository $userRepository;
public function __construct(
UserRepository $userRepository
) {
$this->userRepository = $userRepository;
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
@@ -53,9 +38,9 @@ class ActivityUserAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
// add select element
$qb->addSelect(sprintf('IDENTITY(activity.user) AS %s', self::KEY));
// add the "group by" part
$qb->addGroupBy(self::KEY);
}
@@ -70,30 +55,27 @@ class ActivityUserAggregator implements AggregatorInterface
// nothing to add
}
public function getLabels($key, $values, $data): \Closure
public function getLabels($key, $values, $data): Closure
{
// preload users at once
$this->em->getRepository(User::class)
->findBy(['id' => $values]);
return function($value) {
switch ($value) {
case '_header':
return 'activity user';
default:
return $this->em->getRepository(User::class)->find($value)
->getUsername();
$this->userRepository->findBy(['id' => $values]);
return function ($value) {
if ('_header' === $value) {
return 'activity user';
}
return $this->userRepository->find($value)->getUsername();
};
}
public function getQueryKeys($data)
{
return [ self::KEY ];
return [self::KEY];
}
public function getTitle(): string
{
return "Aggregate by activity user";
return 'Aggregate by activity user';
}
}
@@ -1,121 +1,61 @@
<?php
/*
* Copyright (C) 2015 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Export;
use Chill\MainBundle\Export\ExportInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\Query;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityManagerInterface;
use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\FormatterInterface;
use Doctrine\ORM\Query;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class CountActivity implements ExportInterface
{
/**
*
* @var EntityManagerInterface
*/
protected $entityManager;
protected ActivityRepository $activityRepository;
public function __construct(
EntityManagerInterface $em
)
{
$this->entityManager = $em;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
{
ActivityRepository $activityRepository
) {
$this->activityRepository = $activityRepository;
}
public function getDescription()
public function buildForm(FormBuilderInterface $builder)
{
return "Count activities by various parameters.";
}
public function getTitle()
{
return "Count activities";
}
public function getType()
{
return 'activity';
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
{
$qb = $this->entityManager->createQueryBuilder();
$centers = array_map(function($el) { return $el['center']; }, $acl);
$qb->select('COUNT(activity.id) as export_count_activity')
->from('ChillActivityBundle:Activity', 'activity')
->join('activity.person', 'person')
;
$qb->where($qb->expr()->in('person.center', ':centers'))
->setParameter('centers', $centers)
;
return $qb;
}
public function supportsModifiers()
{
return array('person', 'activity');
}
public function requiredRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function getAllowedFormattersTypes()
{
return array(\Chill\MainBundle\Export\FormatterInterface::TYPE_TABULAR);
return [FormatterInterface::TYPE_TABULAR];
}
public function getDescription()
{
return 'Count activities by various parameters.';
}
public function getLabels($key, array $values, $data)
{
if ($key !== 'export_count_activity') {
throw new \LogicException("the key $key is not used by this export");
if ('export_count_activity' !== $key) {
throw new LogicException("the key {$key} is not used by this export");
}
return function($value) {
return $value === '_header' ?
'Number of activities'
:
$value
;
};
return static fn ($value) => '_header' === $value ? 'Number of activities' : $value;
}
public function getQueryKeys($data)
{
return array('export_count_activity');
return ['export_count_activity'];
}
public function getResult($qb, $data)
@@ -123,4 +63,40 @@ class CountActivity implements ExportInterface
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
public function getTitle()
{
return 'Count activities';
}
public function getType()
{
return 'activity';
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
$qb = $this
->activityRepository
->createQueryBuilder('activity')
->select('COUNT(activity.id) as export_count_activity')
->join('activity.person', 'person');
$qb
->where($qb->expr()->in('person.center', ':centers'))
->setParameter('centers', $centers);
return $qb;
}
public function requiredRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function supportsModifiers()
{
return ['person', 'activity'];
}
}
@@ -1,69 +1,42 @@
<?php
/*
* Copyright (C) 2017 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Export;
use Chill\MainBundle\Export\ListInterface;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Scope;
use Chill\ActivityBundle\Entity\ActivityType;
use Doctrine\ORM\Query\Expr;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\Callback;
use Doctrine\ORM\Query;
use Chill\MainBundle\Export\FormatterInterface;
use Chill\MainBundle\Export\ListInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use DateTime;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function count;
use function in_array;
/**
* Create a list for all activities
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ListActivity implements ListInterface
{
protected EntityManagerInterface $entityManager;
/**
*
* @var EntityManagerInterface
*/
protected $entityManager;
/**
*
* @var TranslatorInterface
*/
protected $translator;
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
protected $fields = array(
protected array $fields = [
'id',
'date',
'durationTime',
@@ -74,115 +47,121 @@ class ListActivity implements ListInterface
'type_name',
'person_firstname',
'person_lastname',
'person_id'
);
'person_id',
];
protected TranslatableStringHelperInterface $translatableStringHelper;
protected TranslatorInterface $translator;
private ActivityRepository $activityRepository;
public function __construct(
EntityManagerInterface $em,
TranslatorInterface $translator,
TranslatableStringHelper $translatableStringHelper
)
{
EntityManagerInterface $em,
TranslatorInterface $translator,
TranslatableStringHelperInterface $translatableStringHelper,
ActivityRepository $activityRepository
) {
$this->entityManager = $em;
$this->translator = $translator;
$this->translatableStringHelper = $translatableStringHelper;
$this->activityRepository = $activityRepository;
}
/**
* {@inheritDoc}
*
* @param FormBuilderInterface $builder
*/
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('fields', ChoiceType::class, array(
$builder->add('fields', ChoiceType::class, [
'multiple' => true,
'expanded' => true,
'choices' => array_combine($this->fields, $this->fields),
'label' => 'Fields to include in export',
'constraints' => [new Callback(array(
'callback' => function($selected, ExecutionContextInterface $context) {
'label' => 'Fields to include in export',
'constraints' => [new Callback([
'callback' => static function ($selected, ExecutionContextInterface $context) {
if (count($selected) === 0) {
$context->buildViolation('You must select at least one element')
->atPath('fields')
->addViolation();
}
}
))]
));
},
])],
]);
}
/**
* {@inheritDoc}
*
* @return type
*/
public function getAllowedFormattersTypes()
{
return array(FormatterInterface::TYPE_LIST);
return [FormatterInterface::TYPE_LIST];
}
public function getDescription()
{
return "List activities";
return 'List activities';
}
public function getLabels($key, array $values, $data)
{
switch ($key)
{
case 'date' :
return function($value) {
if ($value === '_header') return 'date';
switch ($key) {
case 'date':
return static function ($value) {
if ('_header' === $value) {
return 'date';
}
$date = \DateTime::createFromFormat('Y-m-d H:i:s', $value);
$date = DateTime::createFromFormat('Y-m-d H:i:s', $value);
return $date->format('d-m-Y');
};
case 'attendee':
return function($value) {
if ($value === '_header') return 'attendee';
return static function ($value) {
if ('_header' === $value) {
return 'attendee';
}
return $value ? 1 : 0;
};
case 'list_reasons' :
/* @var $activityReasonsRepository EntityRepository */
$activityRepository = $this->entityManager
->getRepository('ChillActivityBundle:Activity');
return function($value) use ($activityRepository) {
if ($value === '_header') return 'activity reasons';
case 'list_reasons':
$activityRepository = $this->activityRepository;
$activity = $activityRepository
->find($value);
return function ($value) use ($activityRepository): string {
if ('_header' === $value) {
return 'activity reasons';
}
return implode(", ", array_map(function(ActivityReason $r) {
$activity = $activityRepository->find($value);
return '"'.
return implode(', ', array_map(function (ActivityReason $r) {
return '"' .
$this->translatableStringHelper->localize($r->getCategory()->getName())
.' > '.
. ' > ' .
$this->translatableStringHelper->localize($r->getName())
.'"';
. '"';
}, $activity->getReasons()->toArray()));
};
case 'circle_name' :
return function($value) {
if ($value === '_header') return 'circle';
return $this->translatableStringHelper
->localize(json_decode($value, true));
};
case 'type_name' :
return function($value) {
if ($value === '_header') return 'activity type';
case 'circle_name':
return function ($value) {
if ('_header' === $value) {
return 'circle';
}
return $this->translatableStringHelper
->localize(json_decode($value, true));
return $this->translatableStringHelper->localize(json_decode($value, true));
};
case 'type_name':
return function ($value) {
if ('_header' === $value) {
return 'activity type';
}
return $this->translatableStringHelper->localize(json_decode($value, true));
};
default:
return function($value) use ($key) {
if ($value === '_header') return $key;
return static function ($value) use ($key) {
if ('_header' === $value) {
return $key;
}
return $value;
};
@@ -209,68 +188,82 @@ class ListActivity implements ListInterface
return 'activity';
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(function($el) { return $el['center']; }, $acl);
$centers = array_map(static function ($el) {
return $el['center'];
}, $acl);
// throw an error if any fields are present
if (!\array_key_exists('fields', $data)) {
throw new \Doctrine\DBAL\Exception\InvalidArgumentException("any fields "
. "have been checked");
if (!array_key_exists('fields', $data)) {
throw new InvalidArgumentException('Any fields have been checked.');
}
$qb = $this->entityManager->createQueryBuilder();
$qb
->from('ChillActivityBundle:Activity', 'activity')
->join('activity.person', 'person')
->join('person.center', 'center')
->andWhere('center IN (:authorized_centers)')
->setParameter('authorized_centers', $centers);
;
->from('ChillActivityBundle:Activity', 'activity')
->join('activity.person', 'person')
->join('person.center', 'center')
->andWhere('center IN (:authorized_centers)')
->setParameter('authorized_centers', $centers);
foreach ($this->fields as $f) {
if (in_array($f, $data['fields'])) {
if (in_array($f, $data['fields'], true)) {
switch ($f) {
case 'id':
$qb->addSelect('activity.id AS id');
break;
case 'person_firstname':
$qb->addSelect('person.firstName AS person_firstname');
break;
case 'person_lastname':
$qb->addSelect('person.lastName AS person_lastname');
break;
case 'person_id':
$qb->addSelect('person.id AS person_id');
break;
case 'user_username':
$qb->join('activity.user', 'user');
$qb->addSelect('user.username AS user_username');
break;
case 'circle_name':
$qb->join('activity.scope', 'circle');
$qb->addSelect('circle.name AS circle_name');
break;
case 'type_name':
$qb->join('activity.type', 'type');
$qb->addSelect('type.name AS type_name');
break;
case 'list_reasons':
// this is a trick... The reasons is filled with the
// activity id which will be used to load reasons
$qb->addSelect('activity.id AS list_reasons');
break;
default:
$qb->addSelect(sprintf('activity.%s as %s', $f, $f));
break;
}
}
}
return $qb;
}
@@ -281,7 +274,6 @@ class ListActivity implements ListInterface
public function supportsModifiers()
{
return array('activity', 'person');
return ['activity', 'person'];
}
}
@@ -1,154 +1,82 @@
<?php
/*
* Copyright (C) 2015 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Export;
use Chill\MainBundle\Export\ExportInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\Query;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityManagerInterface;
use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\FormatterInterface;
use Doctrine\ORM\Query;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
/**
* This export allow to compute stats on activity duration.
*
*
* The desired stat must be given in constructor.
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class StatActivityDuration implements ExportInterface
{
/**
*
* @var EntityManagerInterface
*/
protected $entityManager;
const SUM = 'sum';
public const SUM = 'sum';
/**
* The action for this report.
*
* @var string
*/
protected $action;
protected string $action;
private ActivityRepository $activityRepository;
/**
* constructor
*
* @param EntityManagerInterface $em
* @param string $action the stat to perform
*/
public function __construct(
EntityManagerInterface $em,
$action = 'sum'
)
{
$this->entityManager = $em;
ActivityRepository $activityRepository,
string $action = 'sum'
) {
$this->action = $action;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
{
$this->activityRepository = $activityRepository;
}
public function getDescription()
public function buildForm(FormBuilderInterface $builder)
{
if ($this->action === self::SUM) {
return "Sum activities duration by various parameters.";
}
}
public function getTitle()
{
if ($this->action === self::SUM) {
return "Sum activity duration";
}
}
public function getType()
{
return 'activity';
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
{
$centers = array_map(function($el) { return $el['center']; }, $acl);
$qb = $this->entityManager->createQueryBuilder();
if ($this->action === self::SUM) {
$select = "SUM(activity.durationTime) AS export_stat_activity";
}
$qb->select($select)
->from('ChillActivityBundle:Activity', 'activity')
->join('activity.person', 'person')
->join('person.center', 'center')
->where($qb->expr()->in('center', ':centers'))
->setParameter(':centers', $centers)
;
return $qb;
}
public function supportsModifiers()
{
return array('person', 'activity');
}
public function requiredRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function getAllowedFormattersTypes()
{
return array(\Chill\MainBundle\Export\FormatterInterface::TYPE_TABULAR);
return [FormatterInterface::TYPE_TABULAR];
}
public function getDescription()
{
if (self::SUM === $this->action) {
return 'Sum activities duration by various parameters.';
}
}
public function getLabels($key, array $values, $data)
{
if ($key !== 'export_stat_activity') {
throw new \LogicException("the key $key is not used by this export");
if ('export_stat_activity' !== $key) {
throw new LogicException(sprintf('The key %s is not used by this export', $key));
}
switch ($this->action) {
case self::SUM:
$header = "Sum of activities duration";
}
return function($value) use ($header) {
return $value === '_header' ?
$header
:
$value
;
};
$header = self::SUM === $this->action ? 'Sum of activities duration' : false;
return static fn (string $value) => '_header' === $value ? $header : $value;
}
public function getQueryKeys($data)
{
return array('export_stat_activity');
return ['export_stat_activity'];
}
public function getResult($qb, $data)
@@ -156,4 +84,47 @@ class StatActivityDuration implements ExportInterface
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
public function getTitle()
{
if (self::SUM === $this->action) {
return 'Sum activity duration';
}
}
public function getType()
{
return 'activity';
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(
static fn (array $el): string => $el['center'],
$acl
);
$qb = $this->activityRepository->createQueryBuilder('activity');
$select = null;
if (self::SUM === $this->action) {
$select = 'SUM(activity.durationTime) AS export_stat_activity';
}
return $qb->select($select)
->join('activity.person', 'person')
->join('person.center', 'center')
->where($qb->expr()->in('center', ':centers'))
->setParameter(':centers', $centers);
}
public function requiredRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function supportsModifiers()
{
return ['person', 'activity'];
}
}
@@ -1,69 +1,57 @@
<?php
/*
* Copyright (C) 2017 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\Export\FilterType;
use DateTime;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\FormError;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Doctrine\ORM\Query\Expr;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityDateFilter implements FilterInterface
{
/**
*
* @var TranslatorInterface
*/
protected $translator;
function __construct(TranslatorInterface $translator)
protected TranslatorInterface $translator;
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
public function addRole()
{
return null;
}
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
$clause = $qb->expr()->between('activity.date', ':date_from',
':date_to');
$clause = $qb->expr()->between(
'activity.date',
':date_from',
':date_to'
);
if ($where instanceof Expr\Andx) {
$where->add($clause);
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('date_from', $data['date_from']);
$qb->setParameter('date_to', $data['date_to']);
@@ -74,57 +62,68 @@ class ActivityDateFilter implements FilterInterface
return 'activity';
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('date_from', DateType::class, array(
'label' => "Activities after this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add('date_to', DateType::class, array(
'label' => "Activities before this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
/* @var $filterForm \Symfony\Component\Form\FormInterface */
$builder->add(
'date_from',
DateType::class,
[
'label' => 'Activities after this date',
'data' => new DateTime(),
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
]
);
$builder->add(
'date_to',
DateType::class,
[
'label' => 'Activities before this date',
'data' => new DateTime(),
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
]
);
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
/** @var \Symfony\Component\Form\FormInterface $filterForm */
$filterForm = $event->getForm()->getParent();
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();
if ($enabled === true) {
if (true === $enabled) {
// if the filter is enabled, add some validation
$form = $event->getForm();
$form = $event->getForm();
$date_from = $form->get('date_from')->getData();
$date_to = $form->get('date_to')->getData();
$date_to = $form->get('date_to')->getData();
// check that fields are not empty
if ($date_from === null) {
if (null === $date_from) {
$form->get('date_from')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')));
. 'should not be empty')
));
}
if ($date_to === null) {
if (null === $date_to) {
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')));
}
. 'should not be empty')
));
}
// check that date_from is before date_to
if (
($date_from !== null && $date_to !== null)
&&
$date_from >= $date_to
(null !== $date_from && null !== $date_to)
&& $date_from >= $date_to
) {
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This date should be after '
. 'the date given in "Implied in an activity after '
. 'this date" field')));
. 'this date" field')
));
}
}
});
@@ -132,17 +131,17 @@ class ActivityDateFilter implements FilterInterface
public function describeAction($data, $format = 'string')
{
return array(
"Filtered by date of activity: only between %date_from% and %date_to%",
array(
"%date_from%" => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y')
));
return [
'Filtered by date of activity: only between %date_from% and %date_to%',
[
'%date_from%' => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y'),
],
];
}
public function getTitle()
{
return "Filtered by date activity";
return 'Filtered by date activity';
}
}
@@ -1,88 +1,72 @@
<?php
/*
* Copyright (C) 2016 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\MainBundle\Export\FilterInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityReasonFilter implements FilterInterface,
ExportElementValidatedInterface
use function array_key_exists;
use function count;
class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
{
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
* The repository for activity reasons
*
* @var EntityRepository
*/
protected $reasonRepository;
protected ActivityReasonRepository $activityReasonRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
TranslatableStringHelper $helper,
EntityRepository $reasonRepository
TranslatableStringHelper $helper,
ActivityReasonRepository $activityReasonRepository
) {
$this->translatableStringHelper = $helper;
$this->reasonRepository = $reasonRepository;
$this->activityReasonRepository = $activityReasonRepository;
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
$join = $qb->getDQLPart('join');
$join = $qb->getDQLPart('join');
$clause = $qb->expr()->in('reasons', ':selected_activity_reasons');
//dump($join);
// add a join to reasons only if needed
if (
(array_key_exists('activity', $join)
&&
!$this->checkJoinAlreadyDefined($join['activity'], 'reasons')
(
array_key_exists('activity', $join)
&& !$this->checkJoinAlreadyDefined($join['activity'], 'reasons')
)
OR
(! array_key_exists('activity', $join))
|| (!array_key_exists('activity', $join))
) {
$qb->add(
'join',
array('activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')),
true
);
'join',
['activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')],
true
);
}
if ($where instanceof Expr\Andx) {
@@ -90,27 +74,10 @@ class ActivityReasonFilter implements FilterInterface,
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('selected_activity_reasons', $data['reasons']);
}
/**
* Check if a join between Activity and Reason is already defined
*
* @param Join[] $joins
* @return boolean
*/
private function checkJoinAlreadyDefined(array $joins, $alias)
{
foreach ($joins as $join) {
if ($join->getAlias() === $alias) {
return true;
}
}
return false;
}
public function applyOn()
{
@@ -119,51 +86,59 @@ class ActivityReasonFilter implements FilterInterface,
public function buildForm(FormBuilderInterface $builder)
{
//create a local copy of translatableStringHelper
$helper = $this->translatableStringHelper;
$builder->add('reasons', EntityType::class, array(
'class' => 'ChillActivityBundle:ActivityReason',
'choice_label' => function (ActivityReason $reason) use ($helper) {
return $helper->localize($reason->getName());
},
'group_by' => function(ActivityReason $reason) use ($helper) {
return $helper->localize($reason->getCategory()->getName());
},
$builder->add('reasons', EntityType::class, [
'class' => ActivityReason::class,
'choice_label' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getName()),
'group_by' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
'multiple' => true,
'expanded' => false
));
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['reasons'] === null || count($data['reasons']) === 0) {
$context->buildViolation("At least one reason must be choosen")
->addViolation();
}
'expanded' => false,
]);
}
public function getTitle()
{
return 'Filter by reason';
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function describeAction($data, $format = 'string')
{
// collect all the reasons'name used in this filter in one array
$reasonsNames = array_map(
function(ActivityReason $r) {
return "\"".$this->translatableStringHelper->localize($r->getName())."\"";
},
$this->reasonRepository->findBy(array('id' => $data['reasons']->toArray()))
);
return array("Filtered by reasons: only %list%",
["%list%" => implode(", ", $reasonsNames)]);
fn (ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"',
$this->activityReasonRepository->findBy(['id' => $data['reasons']->toArray()])
);
return [
'Filtered by reasons: only %list%',
[
'%list%' => implode(', ', $reasonsNames),
],
];
}
public function getTitle()
{
return 'Filter by reason';
}
public function validateForm($data, ExecutionContextInterface $context)
{
if (null === $data['reasons'] || count($data['reasons']) === 0) {
$context
->buildViolation('At least one reason must be chosen')
->addViolation();
}
}
/**
* Check if a join between Activity and Reason is already defined.
*
* @param Join[] $joins
* @param mixed $alias
*/
private function checkJoinAlreadyDefined(array $joins, $alias): bool
{
foreach ($joins as $join) {
if ($join->getAlias() === $alias) {
return true;
}
}
return false;
}
}
@@ -1,67 +1,51 @@
<?php
/*
* Copyright (C) 2018 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\MainBundle\Export\FilterInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
*
*
*/
class ActivityTypeFilter implements FilterInterface,
ExportElementValidatedInterface
use function count;
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
{
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
* The repository for activity reasons
*
* @var EntityRepository
*/
protected $typeRepository;
protected ActivityTypeRepository $activityTypeRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
TranslatableStringHelper $helper,
EntityRepository $typeRepository
TranslatableStringHelperInterface $translatableStringHelper,
ActivityTypeRepository $activityTypeRepository
) {
$this->translatableStringHelper = $helper;
$this->typeRepository = $typeRepository;
$this->translatableStringHelper = $translatableStringHelper;
$this->activityTypeRepository = $activityTypeRepository;
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -72,27 +56,10 @@ class ActivityTypeFilter implements FilterInterface,
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('selected_activity_types', $data['types']);
}
/**
* Check if a join between Activity and Reason is already defined
*
* @param Join[] $joins
* @return boolean
*/
private function checkJoinAlreadyDefined(array $joins, $alias)
{
foreach ($joins as $join) {
if ($join->getAlias() === $alias) {
return true;
}
}
return false;
}
public function applyOn()
{
@@ -101,48 +68,64 @@ class ActivityTypeFilter implements FilterInterface,
public function buildForm(FormBuilderInterface $builder)
{
//create a local copy of translatableStringHelper
$helper = $this->translatableStringHelper;
$builder->add('types', EntityType::class, array(
'class' => ActivityType::class,
'choice_label' => function (ActivityType $type) use ($helper) {
return $helper->localize($type->getName());
},
'multiple' => true,
'expanded' => false
));
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['types'] === null || count($data['types']) === 0) {
$context->buildViolation("At least one type must be choosen")
->addViolation();
}
$builder->add(
'types',
EntityType::class,
[
'class' => ActivityType::class,
'choice_label' => fn (ActivityType $type) => $this->translatableStringHelper->localize($type->getName()),
'multiple' => true,
'expanded' => false,
]
);
}
public function getTitle()
{
return 'Filter by activity type';
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function describeAction($data, $format = 'string')
{
// collect all the reasons'name used in this filter in one array
$reasonsNames = array_map(
function(ActivityType $t) {
return "\"".$this->translatableStringHelper->localize($t->getName())."\"";
},
$this->typeRepository->findBy(array('id' => $data['types']->toArray()))
);
return array("Filtered by activity type: only %list%",
["%list%" => implode(", ", $reasonsNames)]);
fn (ActivityType $t): string => '"' . $this->translatableStringHelper->localize($t->getName()) . '"',
$this->activityTypeRepository->findBy(['id' => $data['types']->toArray()])
);
return [
'Filtered by activity type: only %list%',
[
'%list%' => implode(', ', $reasonsNames),
],
];
}
public function getTitle()
{
return 'Filter by activity type';
}
public function validateForm($data, ExecutionContextInterface $context)
{
if (null === $data['types'] || count($data['types']) === 0) {
$context
->buildViolation('At least one type must be chosen')
->addViolation();
}
}
/**
* Check if a join between Activity and Reason is already defined.
*
* @param Join[] $joins
* @param mixed $alias
*
* @return bool
*/
private function checkJoinAlreadyDefined(array $joins, $alias)
{
foreach ($joins as $join) {
if ($join->getAlias() === $alias) {
return true;
}
}
return false;
}
}
@@ -1,106 +1,86 @@
<?php
/*
* Copyright (C) 2017 Champs-Libres <info@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Export\Declarations;
use DateTime;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\FormError;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Doctrine\ORM\Query\Expr;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\ActivityBundle\Entity\ActivityReason;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\EntityManager;
use Chill\PersonBundle\Export\Declarations;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class PersonHavingActivityBetweenDateFilter implements FilterInterface,
ExportElementValidatedInterface
use function count;
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
{
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
*
* @var EntityRepository
*/
protected $activityReasonRepository;
/**
*
* @var TranslatorInterface
*/
protected $translator;
protected ActivityReasonRepository $activityReasonRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
protected TranslatorInterface $translator;
public function __construct(
TranslatableStringHelper $translatableStringHelper,
EntityRepository $activityReasonRepository,
TranslatorInterface $translator
TranslatableStringHelper $translatableStringHelper,
ActivityReasonRepository $activityReasonRepository,
TranslatorInterface $translator
) {
$this->translatableStringHelper = $translatableStringHelper;
$this->activityReasonRepository = $activityReasonRepository;
$this->translator = $translator;
$this->translator = $translator;
}
public function addRole()
{
return null;
}
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data)
{
// create a query for activity
$sqb = $qb->getEntityManager()->createQueryBuilder();
$sqb->select("person_person_having_activity.id")
->from("ChillActivityBundle:Activity", "activity_person_having_activity")
->join("activity_person_having_activity.person", "person_person_having_activity")
;
$sqb->select('person_person_having_activity.id')
->from('ChillActivityBundle:Activity', 'activity_person_having_activity')
->join('activity_person_having_activity.person', 'person_person_having_activity');
// add clause between date
$sqb->where("activity_person_having_activity.date BETWEEN "
. ":person_having_activity_between_date_from"
. " AND "
. ":person_having_activity_between_date_to");
$sqb->where('activity_person_having_activity.date BETWEEN '
. ':person_having_activity_between_date_from'
. ' AND '
. ':person_having_activity_between_date_to');
// add clause activity reason
$sqb->join('activity_person_having_activity.reasons',
'reasons_person_having_activity');
$sqb->join('activity_person_having_activity.reasons', 'reasons_person_having_activity');
$sqb->andWhere(
$sqb->expr()->in(
'reasons_person_having_activity',
":person_having_activity_reasons")
);
$sqb->expr()->in(
'reasons_person_having_activity',
':person_having_activity_reasons'
)
);
$where = $qb->getDQLPart('where');
$clause = $qb->expr()->in('person.id', $sqb->getDQL());
@@ -109,12 +89,16 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface,
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('person_having_activity_between_date_from',
$data['date_from']);
$qb->setParameter('person_having_activity_between_date_to',
$data['date_to']);
$qb->setParameter(
'person_having_activity_between_date_from',
$data['date_from']
);
$qb->setParameter(
'person_having_activity_between_date_to',
$data['date_to']
);
$qb->setParameter('person_having_activity_reasons', $data['reasons']);
}
@@ -123,106 +107,104 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface,
return Declarations::PERSON_IMPLIED_IN;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('date_from', DateType::class, array(
'label' => "Implied in an activity after this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
$builder->add('date_from', DateType::class, [
'label' => 'Implied in an activity after this date',
'data' => new DateTime(),
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add('date_to', DateType::class, array(
'label' => "Implied in an activity before this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
]);
$builder->add('date_to', DateType::class, [
'label' => 'Implied in an activity before this date',
'data' => new DateTime(),
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add('reasons', EntityType::class, array(
'class' => 'ChillActivityBundle:ActivityReason',
'choice_label' => function (ActivityReason $reason) {
return $this->translatableStringHelper
->localize($reason->getName());
},
'group_by' => function(ActivityReason $reason) {
return $this->translatableStringHelper
->localize($reason->getCategory()->getName());
},
]);
$builder->add('reasons', EntityType::class, [
'class' => ActivityReason::class,
'choice_label' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getName()),
'group_by' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
'data' => $this->activityReasonRepository->findAll(),
'multiple' => true,
'expanded' => false,
'label' => "Activity reasons for those activities"
));
$builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
/* @var $filterForm \Symfony\Component\Form\FormInterface */
'label' => 'Activity reasons for those activities',
]);
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
/** @var FormInterface $filterForm */
$filterForm = $event->getForm()->getParent();
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();
if ($enabled === true) {
if (true === $enabled) {
// if the filter is enabled, add some validation
$form = $event->getForm();
$form = $event->getForm();
$date_from = $form->get('date_from')->getData();
$date_to = $form->get('date_to')->getData();
$date_to = $form->get('date_to')->getData();
// check that fields are not empty
if ($date_from === null) {
if (null === $date_from) {
$form->get('date_from')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')));
. 'should not be empty')
));
}
if ($date_to === null) {
if (null === $date_to) {
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')));
}
. 'should not be empty')
));
}
// check that date_from is before date_to
if (
($date_from !== null && $date_to !== null)
&&
$date_from >= $date_to
(null !== $date_from && null !== $date_to)
&& $date_from >= $date_to
) {
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This date '
. 'should be after the date given in "Implied in an '
. 'activity after this date" field')));
. 'activity after this date" field')
));
}
}
});
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['reasons'] === null || count($data['reasons']) === 0) {
$context->buildViolation("At least one reason must be choosen")
->addViolation();
}
}
public function describeAction($data, $format = 'string')
{
return array(
"Filtered by person having an activity between %date_from% and "
. "%date_to% with reasons %reasons_name%",
array(
"%date_from%" => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y'),
"%reasons_name%" => implode(", ", array_map(
function (ActivityReason $r) {
return '"'.$this->translatableStringHelper->
localize($r->getName()).'"';
},
$data['reasons']))
));
return [
'Filtered by person having an activity between %date_from% and '
. '%date_to% with reasons %reasons_name%',
[
'%date_from%' => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y'),
'%reasons_name%' => implode(
', ',
array_map(
fn (ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"',
$data['reasons']
)
),
],
];
}
public function getTitle()
{
return "Filtered by person having an activity in a period";
return 'Filtered by person having an activity in a period';
}
public function validateForm($data, ExecutionContextInterface $context)
{
if (null === $data['reasons'] || count($data['reasons']) === 0) {
$context->buildViolation('At least one reason must be chosen')
->addViolation();
}
}
}
@@ -1,13 +1,22 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityPresence;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class ActivityPresenceType extends AbstractType
{
@@ -15,19 +24,19 @@ class ActivityPresenceType extends AbstractType
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', ChoiceType::class, array(
'choices' => array(
->add('active', ChoiceType::class, [
'choices' => [
'Yes' => true,
'No' => false
),
'expanded' => true
));
'No' => false,
],
'expanded' => true,
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults(array(
'data_class' => ActivityPresence::class
));
$resolver->setDefaults([
'data_class' => ActivityPresence::class,
]);
}
}
@@ -1,25 +1,29 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class ActivityReasonCategoryType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', CheckboxType::class, array('required' => false))
;
->add('active', CheckboxType::class, ['required' => false]);
}
/**
@@ -27,9 +31,9 @@ class ActivityReasonCategoryType extends AbstractType
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReasonCategory'
));
$resolver->setDefaults([
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReasonCategory',
]);
}
/**
@@ -1,37 +1,38 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory;
class ActivityReasonType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', CheckboxType::class, array('required' => false))
->add('category', TranslatableActivityReasonCategory::class)
;
->add('active', CheckboxType::class, ['required' => false])
->add('category', TranslatableActivityReasonCategory::class);
}
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReason'
));
$resolver->setDefaults([
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReason',
]);
}
/**
@@ -1,59 +1,73 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Entity\ActivityPresence;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\DocStoreBundle\Form\StoredObjectType;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\ChillCollectionType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\CommentType;
use Chill\MainBundle\Form\Type\ScopePickerType;
use Chill\MainBundle\Form\Type\UserPickerType;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateInterval;
use DateTime;
use DateTimeZone;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectManager;
use RuntimeException;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Doctrine\Persistence\ObjectManager;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Chill\MainBundle\Entity\User;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\Type\UserPickerType;
use Chill\MainBundle\Form\Type\ScopePickerType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\CallbackTransformer;
use Chill\PersonBundle\Form\DataTransformer\PersonToIdTransformer;
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use function in_array;
class ActivityType extends AbstractType
{
protected User $user;
protected AuthorizationHelper $authorizationHelper;
protected ObjectManager $om;
protected TranslatableStringHelper $translatableStringHelper;
protected SocialActionRender $socialActionRender;
protected SocialIssueRender $socialIssueRender;
protected SocialActionRender $socialActionRender;
protected array $timeChoices;
public function __construct (
protected TranslatableStringHelper $translatableStringHelper;
protected User $user;
public function __construct(
TokenStorageInterface $tokenStorage,
AuthorizationHelper $authorizationHelper,
ObjectManager $om,
@@ -63,7 +77,7 @@ class ActivityType extends AbstractType
SocialActionRender $socialActionRender
) {
if (!$tokenStorage->getToken()->getUser() instanceof User) {
throw new \RuntimeException("you should have a valid user");
throw new RuntimeException('you should have a valid user');
}
$this->user = $tokenStorage->getToken()->getUser();
@@ -93,70 +107,77 @@ class ActivityType extends AbstractType
/** @var \Chill\ActivityBundle\Entity\ActivityType $activityType */
$activityType = $options['activityType'];
if (!$activityType->isActive()) {
throw new \InvalidArgumentException('Activity type must be active');
}
// TODO revoir la gestion des center au niveau du form des activité.
if ($options['center']) {
$builder->add('scope', ScopePickerType::class, [
'center' => $options['center'],
'role' => $options['role']
'role' => $options['role'],
// TODO make required again once scope and rights are fixed
'required' => false,
]);
}
/** @var ? \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod */
$accompanyingPeriod = NULL;
$accompanyingPeriod = null;
if ($options['accompanyingPeriod']) {
$accompanyingPeriod = $options['accompanyingPeriod'];
}
if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) {
$builder->add('socialIssues', HiddenType::class);
$builder->add('socialIssues', HiddenType::class, [
'required' => $activityType->getSocialIssuesVisible() === 2,
]);
$builder->get('socialIssues')
->addModelTransformer(new CallbackTransformer(
function (iterable $socialIssuesAsIterable): string {
$socialIssueIds = [];
foreach ($socialIssuesAsIterable as $value) {
$socialIssueIds[] = $value->getId();
}
return implode(',', $socialIssueIds);
},
function (?string $socialIssuesAsString): array {
if (null === $socialIssuesAsString) {
return [];
}
return array_map(
fn(string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialIssuesAsString)
);
}
))
;
->addModelTransformer(new CallbackTransformer(
static function (iterable $socialIssuesAsIterable): string {
$socialIssueIds = [];
foreach ($socialIssuesAsIterable as $value) {
$socialIssueIds[] = $value->getId();
}
return implode(',', $socialIssueIds);
},
function (?string $socialIssuesAsString): array {
if (null === $socialIssuesAsString) {
return [];
}
return array_map(
fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialIssuesAsString)
);
}
));
}
if ($activityType->isVisible('socialActions') && $accompanyingPeriod) {
$builder->add('socialActions', HiddenType::class);
$builder->add('socialActions', HiddenType::class, [
'required' => $activityType->getSocialActionsVisible() === 2,
]);
$builder->get('socialActions')
->addModelTransformer(new CallbackTransformer(
function (iterable $socialActionsAsIterable): string {
$socialActionIds = [];
foreach ($socialActionsAsIterable as $value) {
$socialActionIds[] = $value->getId();
}
return implode(',', $socialActionIds);
},
function (?string $socialActionsAsString): array {
if (null === $socialActionsAsString) {
return [];
}
return array_map(
fn(string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialActionsAsString)
);
}
))
;
->addModelTransformer(new CallbackTransformer(
static function (iterable $socialActionsAsIterable): string {
$socialActionIds = [];
foreach ($socialActionsAsIterable as $value) {
$socialActionIds[] = $value->getId();
}
return implode(',', $socialActionIds);
},
function (?string $socialActionsAsString): array {
if (null === $socialActionsAsString) {
return [];
}
return array_map(
fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialActionsAsString)
);
}
));
}
if ($activityType->isVisible('date')) {
@@ -189,7 +210,7 @@ class ActivityType extends AbstractType
'choice_label' => function (ActivityPresence $activityPresence) {
return $this->translatableStringHelper->localize($activityPresence->getName());
},
'query_builder' => function (EntityRepository $er) {
'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('a')
->where('a.active = true');
},
@@ -201,7 +222,7 @@ class ActivityType extends AbstractType
'label' => $activityType->getLabel('user'),
'required' => $activityType->isRequired('user'),
'center' => $options['center'],
'role' => $options['role']
'role' => $options['role'],
]);
}
@@ -214,8 +235,8 @@ class ActivityType extends AbstractType
'choice_label' => function (ActivityReason $activityReason) {
return $this->translatableStringHelper->localize($activityReason->getName());
},
'attr' => array('class' => 'select2 '),
'query_builder' => function (EntityRepository $er) {
'attr' => ['class' => 'select2 '],
'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('a')
->where('a.active = true');
},
@@ -224,7 +245,7 @@ class ActivityType extends AbstractType
if ($activityType->isVisible('comment')) {
$builder->add('comment', CommentType::class, [
'label' => empty($activityType->getLabel('comment'))
'label' => empty($activityType->getLabel('comment'))
? 'activity.comment' : $activityType->getLabel('comment'),
'required' => $activityType->isRequired('comment'),
]);
@@ -233,43 +254,53 @@ class ActivityType extends AbstractType
if ($activityType->isVisible('persons')) {
$builder->add('persons', HiddenType::class);
$builder->get('persons')
->addModelTransformer(new CallbackTransformer(
function (iterable $personsAsIterable): string {
$personIds = [];
foreach ($personsAsIterable as $value) {
$personIds[] = $value->getId();
}
return implode(',', $personIds);
},
function (?string $personsAsString): array {
return array_map(
fn(string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
explode(',', $personsAsString)
);
}
))
;
->addModelTransformer(new CallbackTransformer(
static function (iterable $personsAsIterable): string {
$personIds = [];
foreach ($personsAsIterable as $value) {
$personIds[] = $value->getId();
}
return implode(',', $personIds);
},
function (?string $personsAsString): array {
if (null === $personsAsString) {
return [];
}
return array_map(
fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
explode(',', $personsAsString)
);
}
));
}
if ($activityType->isVisible('thirdParties')) {
$builder->add('thirdParties', HiddenType::class);
$builder->get('thirdParties')
->addModelTransformer(new CallbackTransformer(
function (iterable $thirdpartyAsIterable): string {
$thirdpartyIds = [];
foreach ($thirdpartyAsIterable as $value) {
$thirdpartyIds[] = $value->getId();
}
return implode(',', $thirdpartyIds);
},
function (?string $thirdpartyAsString): array {
return array_map(
fn(string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
explode(',', $thirdpartyAsString)
);
}
))
;
->addModelTransformer(new CallbackTransformer(
static function (iterable $thirdpartyAsIterable): string {
$thirdpartyIds = [];
foreach ($thirdpartyAsIterable as $value) {
$thirdpartyIds[] = $value->getId();
}
return implode(',', $thirdpartyIds);
},
function (?string $thirdpartyAsString): array {
if (null === $thirdpartyAsString) {
return [];
}
return array_map(
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
explode(',', $thirdpartyAsString)
);
}
));
}
if ($activityType->isVisible('documents')) {
@@ -278,30 +309,56 @@ class ActivityType extends AbstractType
'label' => $activityType->getLabel('documents'),
'required' => $activityType->isRequired('documents'),
'allow_add' => true,
'allow_delete' => true,
'button_add_label' => 'activity.Insert a document',
'button_remove_label' => 'activity.Remove a document'
'button_remove_label' => 'activity.Remove a document',
'empty_collection_explain' => 'No documents',
]);
}
if ($activityType->isVisible('users')) {
$builder->add('users', HiddenType::class);
$builder->get('users')
->addModelTransformer(new CallbackTransformer(
function (iterable $usersAsIterable): string {
$userIds = [];
foreach ($usersAsIterable as $value) {
$userIds[] = $value->getId();
}
return implode(',', $userIds);
},
function (?string $usersAsString): array {
return array_map(
fn(string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
explode(',', $usersAsString)
);
}
))
;
->addModelTransformer(new CallbackTransformer(
static function (iterable $usersAsIterable): string {
$userIds = [];
foreach ($usersAsIterable as $value) {
$userIds[] = $value->getId();
}
return implode(',', $userIds);
},
function (?string $usersAsString): array {
if (null === $usersAsString) {
return [];
}
return array_map(
fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
explode(',', $usersAsString)
);
}
));
}
if ($activityType->isVisible('location')) {
$builder->add('location', HiddenType::class, [
'required' => $activityType->getLocationVisible() === 2,
])
->get('location')
->addModelTransformer(new CallbackTransformer(
static function (?Location $location): string {
if (null === $location) {
return '';
}
return (string) $location->getId();
},
function (?string $id): ?Location {
return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]);
}
));
}
if ($activityType->isVisible('emergency')) {
@@ -331,7 +388,7 @@ class ActivityType extends AbstractType
->addModelTransformer($durationTimeTransformer);
$builder->get($fieldName)
->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $formEvent) use (
->addEventListener(FormEvents::PRE_SET_DATA, static function (FormEvent $formEvent) use (
$timeChoices,
$builder,
$durationTimeTransformer,
@@ -340,24 +397,25 @@ class ActivityType extends AbstractType
) {
// set the timezone to GMT, and fix the difference between current and GMT
// the datetimetransformer will then handle timezone as GMT
$timezoneUTC = new \DateTimeZone('GMT');
/* @var $data \DateTime */
$data = $formEvent->getData() === NULL ?
\DateTime::createFromFormat('U', 300) :
$timezoneUTC = new DateTimeZone('GMT');
/** @var DateTime $data */
$data = $formEvent->getData() === null ?
DateTime::createFromFormat('U', '300') :
$formEvent->getData();
$seconds = $data->getTimezone()->getOffset($data);
$data->setTimeZone($timezoneUTC);
$data->add(new \DateInterval('PT'.$seconds.'S'));
$data->add(new DateInterval('PT' . $seconds . 'S'));
// test if the timestamp is in the choices.
// If not, recreate the field with the new timestamp
if (!in_array($data->getTimestamp(), $timeChoices)) {
if (!in_array($data->getTimestamp(), $timeChoices, true)) {
// the data are not in the possible values. add them
$timeChoices[$data->format('H:i')] = $data->getTimestamp();
$form = $builder->create($fieldName, ChoiceType::class, array_merge(
$durationTimeOptions, [
$durationTimeOptions,
[
'choices' => $timeChoices,
'auto_initialize' => false
'auto_initialize' => false,
]
));
$form->addModelTransformer($durationTimeTransformer);
@@ -367,12 +425,10 @@ class ActivityType extends AbstractType
}
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Activity::class
'data_class' => Activity::class,
]);
$resolver
@@ -380,8 +436,7 @@ class ActivityType extends AbstractType
->setAllowedTypes('center', ['null', 'Chill\MainBundle\Entity\Center'])
->setAllowedTypes('role', 'Symfony\Component\Security\Core\Role\Role')
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null'])
;
->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']);
}
public function getBlockPrefix(): string
@@ -1,14 +1,23 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class ActivityTypeCategoryType extends AbstractType
{
@@ -16,24 +25,23 @@ class ActivityTypeCategoryType extends AbstractType
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', ChoiceType::class, array(
'choices' => array(
->add('active', ChoiceType::class, [
'choices' => [
'Yes' => true,
'No' => false
),
'expanded' => true
))
'No' => false,
],
'expanded' => true,
])
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 5
])
;
'scale' => 5,
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults(array(
'data_class' => ActivityTypeCategory::class
));
$resolver->setDefaults([
'data_class' => ActivityTypeCategory::class,
]);
}
}
@@ -1,18 +1,27 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Chill\ActivityBundle\Form\Type\ActivityFieldPresence;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class ActivityTypeType extends AbstractType
{
@@ -30,9 +39,9 @@ class ActivityTypeType extends AbstractType
->add('active', ChoiceType::class, [
'choices' => [
'Yes' => true,
'No' => false
'No' => false,
],
'expanded' => true
'expanded' => true,
])
->add('category', EntityType::class, [
'class' => ActivityTypeCategory::class,
@@ -42,20 +51,20 @@ class ActivityTypeType extends AbstractType
])
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 5
])
;
'scale' => 5,
]);
$fields = [
'persons', 'user', 'date', 'place', 'persons',
'persons', 'user', 'date', 'location', 'persons',
'thirdParties', 'durationTime', 'travelTime', 'attendee',
'reasons', 'comment', 'sentReceived', 'documents',
'emergency', 'accompanyingPeriod', 'socialData', 'users'
'emergency', 'socialIssues', 'socialActions', 'users',
];
foreach ($fields as $field) {
$builder
->add($field.'Visible', ActivityFieldPresence::class)
->add($field.'Label', TextType::class, [
->add($field . 'Visible', ActivityFieldPresence::class)
->add($field . 'Label', TextType::class, [
'required' => false,
'empty_data' => '',
]);
@@ -64,8 +73,8 @@ class ActivityTypeType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => \Chill\ActivityBundle\Entity\ActivityType::class
));
$resolver->setDefaults([
'data_class' => \Chill\ActivityBundle\Entity\ActivityType::class,
]);
}
}
@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Entity\ActivityType;
@@ -9,21 +18,21 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ActivityFieldPresence extends AbstractType
{
public function getParent()
{
return ChoiceType::class;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
[
'choices' => [
'Invisible' => ActivityType::FIELD_INVISIBLE,
'Optional' => ActivityType::FIELD_OPTIONAL,
'Required' => ActivityType::FIELD_REQUIRED,
],
)
]
);
}
public function getParent()
{
return ChoiceType::class;
}
}
@@ -1,54 +1,39 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2020, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\EntityRepository;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Templating\Entity\ActivityReasonRender;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* FormType to choose amongst activity reasons
*
* FormType to choose amongst activity reasons.
*/
class TranslatableActivityReason extends AbstractType
{
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
*
* @var ActivityReasonRender
*/
protected $reasonRender;
/**
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
public function __construct(
TranslatableStringHelper $translatableStringHelper,
ActivityReasonRender $reasonRender
@@ -57,6 +42,30 @@ class TranslatableActivityReason extends AbstractType
$this->reasonRender = $reasonRender;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'class' => 'ChillActivityBundle:ActivityReason',
'choice_label' => function (ActivityReason $choice) {
return $this->reasonRender->renderString($choice, []);
},
'group_by' => function (ActivityReason $choice): ?string {
if (null !== $category = $choice->getCategory()) {
return $this->translatableStringHelper->localize($category->getName());
}
return null;
},
'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('r')
->where('r.active = true');
},
'attr' => ['class' => ' select2 '],
]
);
}
public function getBlockPrefix()
{
return 'translatable_activity_reason';
@@ -66,28 +75,4 @@ class TranslatableActivityReason extends AbstractType
{
return EntityType::class;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'class' => 'ChillActivityBundle:ActivityReason',
'choice_label' => function(ActivityReason $choice) {
return $this->reasonRender->renderString($choice, []);
},
'group_by' => function(ActivityReason $choice): ?string {
if (null !== $category = $choice->getCategory()) {
return $this->translatableStringHelper->localize($category->getName());
}
return null;
},
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('r')
->where('r.active = true');
},
'attr' => [ 'class' => ' select2 ']
)
);
}
}
@@ -1,40 +1,25 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Description of TranslatableActivityReasonCategory
*
* @author Champs-Libres Coop
* Description of TranslatableActivityReasonCategory.
*/
class TranslatableActivityReasonCategory extends AbstractType
{
/**
@@ -47,6 +32,21 @@ class TranslatableActivityReasonCategory extends AbstractType
$this->requestStack = $requestStack;
}
public function configureOptions(OptionsResolver $resolver)
{
$locale = $this->requestStack->getCurrentRequest()->getLocale();
$resolver->setDefaults(
[
'class' => 'ChillActivityBundle:ActivityReasonCategory',
'choice_label' => 'name[' . $locale . ']',
'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('c')
->where('c.active = true');
},
]
);
}
public function getBlockPrefix()
{
return 'translatable_activity_reason_category';
@@ -56,19 +56,4 @@ class TranslatableActivityReasonCategory extends AbstractType
{
return EntityType::class;
}
public function configureOptions(OptionsResolver $resolver)
{
$locale = $this->requestStack->getCurrentRequest()->getLocale();
$resolver->setDefaults(
array(
'class' => 'ChillActivityBundle:ActivityReasonCategory',
'choice_label' => 'name['.$locale.']',
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('c')
->where('c.active = true');
}
)
);
}
}
@@ -1,60 +1,66 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\EntityRepository;
use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Description of TranslatableActivityType
*
* @author Champs-Libres Coop
*/
class TranslatableActivityType extends AbstractType
{
protected ActivityTypeRepository $activityTypeRepository;
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
protected $activityTypeRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
TranslatableStringHelper $helper,
EntityRepository $activityTypeRepository
)
{
TranslatableStringHelperInterface $helper,
ActivityTypeRepository $activityTypeRepository
) {
$this->translatableStringHelper = $helper;
$this->activityTypeRepository = $activityTypeRepository;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
/** @var QueryBuilder $qb */
$qb = $options['query_builder'];
if (true === $options['active_only']) {
$qb->where($qb->expr()->eq('at.active', ':active'));
$qb->setParameter('active', true, Types::BOOLEAN);
}
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'class' => ActivityType::class,
'active_only' => true,
'query_builder' => $this->activityTypeRepository
->createQueryBuilder('at'),
'choice_label' => function (ActivityType $type) {
return $this->translatableStringHelper->localize($type->getName());
},
]
);
}
public function getBlockPrefix()
{
return 'translatable_activity_type';
@@ -64,30 +70,4 @@ class TranslatableActivityType extends AbstractType
{
return EntityType::class;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options) {
/* @var $qb \Doctrine\ORM\QueryBuilder */
$qb = $options['query_builder'];
if ($options['active_only'] === true) {
$qb->where($qb->expr()->eq('at.active', ':active'));
$qb->setParameter('active', true, \Doctrine\DBAL\Types\Type::BOOLEAN);
}
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'class' => 'ChillActivityBundle:ActivityType',
'active_only' => true,
'query_builder' => $this->activityTypeRepository
->createQueryBuilder('at'),
'choice_label' => function (ActivityType $type) {
return $this->translatableStringHelper->localize($type->getName());
}
)
);
}
}
@@ -1,47 +1,56 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Menu;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
{
protected TokenStorageInterface $tokenStorage;
protected AuthorizationHelper $authorizationHelper;
protected Security $security;
protected TranslatorInterface $translator;
public function __construct(
TokenStorageInterface $tokenStorage,
AuthorizationHelper $authorizationHelper,
Security $security,
TranslatorInterface $translator
) {
$this->security = $security;
$this->translator = $translator;
$this->authorizationHelper = $authorizationHelper;
$this->tokenStorage = $tokenStorage;
}
public static function getMenuIds(): array
{
return ['accompanyingCourse'];
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
$period = $parameters['accompanyingCourse'];
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) {
if (
AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
&& $this->security->isGranted(ActivityVoter::SEE, $period)
) {
$menu->addChild($this->translator->trans('Activity'), [
'route' => 'chill_activity_activity_list',
'routeParameters' => [
'accompanying_period_id' => $period->getId(),
]])
], ])
->setExtras(['order' => 40]);
}
}
public static function getMenuIds(): array
{
return ['accompanyingCourse'];
}
}
@@ -0,0 +1,58 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security;
use function in_array;
final class AdminMenuBuilder implements LocalMenuBuilderInterface
{
private Security $security;
public function __construct(Security $security)
{
$this->security = $security;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
if (!$this->security->isGranted('ROLE_ADMIN')) {
return;
}
if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild('Activities', [
'route' => 'chill_admin_activity_index',
])
->setExtras([
'order' => 2000,
'explain' => 'Activity configuration',
]);
} else {
$menu
->addChild('Activities', [
'route' => 'chill_admin_activity_index',
])
->setExtras([
'order' => '60',
]);
}
}
public static function getMenuIds(): array
{
return ['admin_index', 'admin_section', 'admin_activity'];
}
}
@@ -1,68 +1,56 @@
<?php
/*
* Copyright (C) 2018 Julien Fastré <julien.fastre@champs-libres.coop>
/**
* Chill is a software for social workers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Menu;
declare(strict_types=1);
namespace Chill\ActivityBundle\Menu;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class PersonMenuBuilder implements LocalMenuBuilderInterface
{
/**
*
* @var TranslatorInterface
*/
protected $translator;
/**
*
* @var AuthorizationCheckerInterface
*/
protected $authorizationChecker;
/**
* @var TranslatorInterface
*/
protected $translator;
public function __construct(
AuthorizationCheckerInterface $authorizationChecker,
TranslatorInterface $translator)
{
TranslatorInterface $translator
) {
$this->translator = $translator;
$this->authorizationChecker = $authorizationChecker;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
/* @var $person \Chill\PersonBundle\Entity\Person */
/** @var \Chill\PersonBundle\Entity\Person $person */
$person = $parameters['person'];
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
$menu->addChild(
$this->translator->trans('Activity list'), [
$this->translator->trans('Activity list'),
[
'route' => 'chill_activity_activity_list',
'routeParameters' => [ 'person_id' => $person->getId() ],
])
->setExtra('order', 201)
;
'routeParameters' => ['person_id' => $person->getId()],
]
)
->setExtra('order', 201);
}
}
@@ -0,0 +1,45 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Notification;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\MainBundle\Entity\Notification;
use Chill\MainBundle\Notification\NotificationHandlerInterface;
final class ActivityNotificationHandler implements NotificationHandlerInterface
{
private ActivityRepository $activityRepository;
public function __construct(ActivityRepository $activityRepository)
{
$this->activityRepository = $activityRepository;
}
public function getTemplate(Notification $notification, array $options = []): string
{
return '@ChillActivity/Activity/showInNotification.html.twig';
}
public function getTemplateData(Notification $notification, array $options = []): array
{
return [
'notification' => $notification,
'activity' => $this->activityRepository->find($notification->getRelatedEntityId()),
];
}
public function supports(Notification $notification, array $options = []): bool
{
return $notification->getRelatedEntityClass() === Activity::class;
}
}
@@ -1,24 +0,0 @@
<?php
namespace Chill\ActivityBundle\Notification;
use Chill\MainBundle\Entity\Notification;
use Chill\ActivityBundle\Entity\Activity;
final class ActivityNotificationRenderer
{
public function supports(Notification $notification, array $options = []): bool
{
return $notification->getRelatedEntityClass() == Activity::class;
}
public function getTemplate()
{
return '@ChillActivity/Activity/showInNotification.html.twig';
}
public function getTemplateData(Notification $notification)
{
return ['notification' => $notification];
}
}
@@ -1,60 +1,48 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Entity\Scope;
use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Query\Expr\Orx;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Security\Core\Security;
use function count;
use function in_array;
final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
{
private AuthorizationHelper $authorizationHelper;
private TokenStorageInterface $tokenStorage;
private ActivityRepository $repository;
private CenterResolverDispatcherInterface $centerResolverDispatcher;
private EntityManagerInterface $em;
private ActivityRepository $repository;
private Security $security;
private CenterResolverDispatcher $centerResolverDispatcher;
private TokenStorageInterface $tokenStorage;
public function __construct(
AuthorizationHelper $authorizationHelper,
CenterResolverDispatcher $centerResolverDispatcher,
CenterResolverDispatcherInterface $centerResolverDispatcher,
TokenStorageInterface $tokenStorage,
ActivityRepository $repository,
EntityManagerInterface $em,
@@ -68,34 +56,11 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
$this->security = $security;
}
/**
* @param Person $person
* @param string $role
* @param int|null $start
* @param int|null $limit
* @param array $orderBy
* @return array|Activity[]
*/
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array
{
$user = $this->security->getUser();
$center = $this->centerResolverDispatcher->resolveCenter($person);
if (0 === count($orderBy)) {
$orderBy = ['date' => 'DESC'];
}
$reachableScopes = $this->authorizationHelper
->getReachableCircles($user, $role, $center);
return $this->em->getRepository(Activity::class)
->findByPersonImplied($person, $reachableScopes, $orderBy, $limit, $start);
;
}
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array
{
$user = $this->security->getUser();
$center = $this->centerResolverDispatcher->resolveCenter($period);
if (0 === count($orderBy)) {
$orderBy = ['date' => 'DESC'];
}
@@ -107,6 +72,27 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
->findByAccompanyingPeriod($period, $scopes, true, $limit, $start, $orderBy);
}
/**
* @param array $orderBy
*
* @return Activity[]|array
*/
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array
{
$user = $this->security->getUser();
$center = $this->centerResolverDispatcher->resolveCenter($person);
if (0 === count($orderBy)) {
$orderBy = ['date' => 'DESC'];
}
$reachableScopes = $this->authorizationHelper
->getReachableCircles($user, $role, $center);
return $this->em->getRepository(Activity::class)
->findByPersonImplied($person, $reachableScopes, $orderBy, $limit, $start);
}
public function queryTimelineIndexer(string $context, array $args = []): array
{
$metadataActivity = $this->em->getClassMetadata(Activity::class);
@@ -115,15 +101,15 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
[$where, $parameters] = $this->getWhereClause($context, $args);
return [
'id' => $metadataActivity->getTableName()
.'.'.$metadataActivity->getColumnName('id'),
'type' => 'activity',
'date' => $metadataActivity->getTableName()
.'.'.$metadataActivity->getColumnName('date'),
'FROM' => $from,
'WHERE' => $where,
'parameters' => $parameters
];
'id' => $metadataActivity->getTableName()
. '.' . $metadataActivity->getColumnName('id'),
'type' => 'activity',
'date' => $metadataActivity->getTableName()
. '.' . $metadataActivity->getColumnName('date'),
'FROM' => $from,
'WHERE' => $where,
'parameters' => $parameters,
];
}
private function getFromClauseCenter(array $args): string
@@ -132,13 +118,12 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
$metadataPerson = $this->em->getClassMetadata(Person::class);
$associationMapping = $metadataActivity->getAssociationMapping('person');
return $metadataActivity->getTableName().' JOIN '
.$metadataPerson->getTableName().' ON '
.$metadataPerson->getTableName().'.'.
return $metadataActivity->getTableName() . ' JOIN '
. $metadataPerson->getTableName() . ' ON '
. $metadataPerson->getTableName() . '.' .
$associationMapping['joinColumns'][0]['referencedColumnName']
.' = '
.$associationMapping['joinColumns'][0]['name']
;
. ' = '
. $associationMapping['joinColumns'][0]['name'];
}
private function getWhereClause(string $context, array $args): array
@@ -149,21 +134,22 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
$metadataActivity = $this->em->getClassMetadata(Activity::class);
$metadataPerson = $this->em->getClassMetadata(Person::class);
$activityToPerson = $metadataActivity->getAssociationMapping('person')['joinColumns'][0]['name'];
$activityToScope = $metadataActivity->getAssociationMapping('scope')['joinColumns'][0]['name'];
$activityToScope = $metadataActivity->getAssociationMapping('scope')['joinColumns'][0]['name'];
$personToCenter = $metadataPerson->getAssociationMapping('center')['joinColumns'][0]['name'];
// acls:
$role = new Role(ActivityVoter::SEE);
$reachableCenters = $this->authorizationHelper->getReachableCenters($this->tokenStorage->getToken()->getUser(),
$role);
$reachableCenters = $this->authorizationHelper->getReachableCenters(
$this->tokenStorage->getToken()->getUser(),
$role
);
if (count($reachableCenters) === 0) {
// insert a dummy condition
return 'FALSE = TRUE';
}
if ($context === 'person') {
if ('person' === $context) {
// we start with activities having the person_id linked to person
$where .= sprintf('%s = ? AND ', $activityToPerson);
$parameters[] = $person->getId();
@@ -172,21 +158,24 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
// we add acl (reachable center and scopes)
$where .= '('; // first loop for the for centers
$centersI = 0; // like centers#i
foreach ($reachableCenters as $center) {
// we pass if not in centers
if (!\in_array($center, $args['centers'])) {
if (!in_array($center, $args['centers'], true)) {
continue;
}
// we get all the reachable scopes for this center
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
// we get the ids for those scopes
$reachablesScopesId = array_map(
function(Scope $scope) { return $scope->getId(); },
static function (Scope $scope) {
return $scope->getId();
},
$reachableScopes
);
// if not the first center
if ($centersI > 0) {
if (0 < $centersI) {
$where .= ') OR (';
}
@@ -199,21 +188,20 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
$scopesI = 0; //like scope#i
foreach ($reachablesScopesId as $scopeId) {
if ($scopesI > 0) {
if (0 < $scopesI) {
$where .= ' OR ';
}
$where .= sprintf(' %s.%s = ? ', $metadataActivity->getTableName(), $activityToScope);
$parameters[] = $scopeId;
$scopesI ++;
++$scopesI;
}
// close loop for scopes
$where .= ') ';
$centersI++;
++$centersI;
}
// close loop for centers
$where .= ')';
return [$where, $parameters];
}
}
@@ -1,5 +1,14 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
@@ -8,12 +17,12 @@ use Chill\PersonBundle\Entity\Person;
interface ActivityACLAwareRepositoryInterface
{
/**
* @return array|Activity[]
*/
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
/**
* @return array|Activity[]
* @return Activity[]|array
*/
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
/**
* @return Activity[]|array
*/
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
}
@@ -0,0 +1,30 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityReasonCategory|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityReasonCategory|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityReasonCategory[] findAll()
* @method ActivityReasonCategory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityReasonCategoryRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityReasonCategory::class);
}
}
@@ -0,0 +1,30 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityReason;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityReason|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityReason|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityReason[] findAll()
* @method ActivityReason[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityReasonRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityReason::class);
}
}
@@ -1,25 +1,14 @@
<?php
/*
/**
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\Activity;
@@ -29,10 +18,10 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method AccompanyingPeriodParticipation|null find($id, $lockMode = null, $lockVersion = null)
* @method AccompanyingPeriodParticipation|null findOneBy(array $criteria, array $orderBy = null)
* @method AccompanyingPeriodParticipation[] findAll()
* @method AccompanyingPeriodParticipation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
* @method Activity|null find($id, $lockMode = null, $lockVersion = null)
* @method Activity|null findOneBy(array $criteria, array $orderBy = null)
* @method Activity[] findAll()
* @method Activity[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityRepository extends ServiceEntityRepository
{
@@ -42,14 +31,49 @@ class ActivityRepository extends ServiceEntityRepository
}
/**
* @param $person
* @param array $scopes
* @param string[] $orderBy
* @param int $limit
* @param int $offset
* @return array|Activity[]
* @deprecated use @see{ActivityACLAwareRepositoryInterface::findByAccompanyingPeriod}
*
* @return Activity[]
*/
public function findByPersonImplied(Person $person, array $scopes, ?array $orderBy = [ 'date' => 'DESC'], ?int $limit = 100, ?int $offset = 0): array
public function findByAccompanyingPeriod(AccompanyingPeriod $period, array $scopes, ?bool $allowNullScope = false, ?int $limit = 100, ?int $offset = 0, array $orderBy = ['date' => 'desc']): array
{
$qb = $this->createQueryBuilder('a');
$qb->select('a');
if (!$allowNullScope) {
$qb
->where($qb->expr()->in('a.scope', ':scopes'))
->setParameter('scopes', $scopes);
} else {
$qb
->where(
$qb->expr()->orX(
$qb->expr()->in('a.scope', ':scopes'),
$qb->expr()->isNull('a.scope')
)
)
->setParameter('scopes', $scopes);
}
$qb
->andWhere(
$qb->expr()->eq('a.accompanyingPeriod', ':period')
)
->setParameter('period', $period);
foreach ($orderBy as $k => $dir) {
$qb->addOrderBy('a.' . $k, $dir);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()->getResult();
}
/**
* @return Activity[]
*/
public function findByPersonImplied(Person $person, array $scopes, ?array $orderBy = ['date' => 'DESC'], ?int $limit = 100, ?int $offset = 0): array
{
$qb = $this->createQueryBuilder('a');
$qb->select('a');
@@ -63,63 +87,14 @@ class ActivityRepository extends ServiceEntityRepository
':person MEMBER OF a.persons'
)
)
->setParameter('person', $person)
;
->setParameter('person', $person);
foreach ($orderBy as $k => $dir) {
$qb->addOrderBy('a.'.$k, $dir);
$qb->addOrderBy('a.' . $k, $dir);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()
->getResult();
}
/**
* @param AccompanyingPeriod $period
* @param array $scopes
* @param int|null $limit
* @param int|null $offset
* @param array|string[] $orderBy
* @return array|Activity[]
*/
public function findByAccompanyingPeriod(AccompanyingPeriod $period, array $scopes, ?bool $allowNullScope = false, ?int $limit = 100, ?int $offset = 0, array $orderBy = ['date' => 'desc']): array
{
$qb = $this->createQueryBuilder('a');
$qb->select('a');
if (!$allowNullScope) {
$qb
->where($qb->expr()->in('a.scope', ':scopes'))
->setParameter('scopes', $scopes)
;
} else {
$qb
->where(
$qb->expr()->orX(
$qb->expr()->in('a.scope', ':scopes'),
$qb->expr()->isNull('a.scope')
)
)
->setParameter('scopes', $scopes)
;
}
$qb
->andWhere(
$qb->expr()->eq('a.accompanyingPeriod', ':period')
)
->setParameter('period', $period)
;
foreach ($orderBy as $k => $dir) {
$qb->addOrderBy('a.'.$k, $dir);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()
->getResult();
return $qb->getQuery()->getResult();
}
}
@@ -0,0 +1,30 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityTypeCategory|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityTypeCategory|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityTypeCategory[] findAll()
* @method ActivityTypeCategory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityTypeCategoryRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityTypeCategory::class);
}
}
@@ -0,0 +1,30 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityType;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityType|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityType|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityType[] findAll()
* @method ActivityType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityTypeRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityType::class);
}
}
@@ -1,14 +1,17 @@
// Access to Bootstrap variables and mixins
@import '~ChillMainAssets/module/bootstrap/shared';
// activity creation first step: select type page
//// ACTIVITY CREATION
// first step: select type page
div.new-activity-select-type {
div.activity-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
justify-content: flex-start;
gap: 12px;
margin-bottom: 30px;
div.bloc {
width: 200px;
@@ -21,91 +24,37 @@ div.new-activity-select-type {
}
}
// exceptions for flex-table in list-records
div.activity-list {
div.flex-table {
div.item-bloc {
div.item-row.main {
div.item-col {
&:first-child {
flex-basis: 15%;
}
ul.list-content {
li.social-issues, li.social-actions {
.badge-primary {
font-variant: small-caps;
font-weight: bold;
font-size: 88%;
margin-bottom: 0.2em;
}
}
li.social-issues .badge-primary {
background-color: $orange;
}
li.social-actions .badge-primary {
background-color: $green;
}
}
}
}
div.item-row.comment {
margin-left: 15%;
blockquote.chill-user-quote {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
}
div.item-row.details {
margin-left: 15%;
// override flex-bloc to adapt in list
// TODO refund this
div.accompanyingCourse.flex-bloc.concerned-groups {
margin: 0;
width: 100%;
justify-content: space-around;
div.item-bloc {
box-shadow: unset;
padding: 0;
flex-basis: 25%;
div.item-row {
flex-direction: column;
div.item-col {
&:first-child {
width: unset;
}
&:last-child {
border-top: 0;
margin-top: 0;
padding-top: 0;
ul.list-content {
padding: 0;
}
}
}
}
}
}
//// ACTIVITY LIST PAGE
// precise dashboard specific details
p.date-label {
display: inline-block;
margin: 0 0.5em 0 0;
font-weight: 700;
font-size: 18pt;
}
div.dashboard,
h4.badge-title,
h3.badge-title,
h2.badge-title {
ul.list-content {
font-size: 70%;
list-style-type: none;
padding-left: 0;
margin: 0;
li {
margin-bottom: 0.2em;
// exception: change bg color for action badges above dashboard
.bg-light {
background-color: $chill-light-gray !important;
}
ul.list-content {
list-style-type: none;
padding-left: 1em;
margin: 0 0;
li {
margin-bottom: 0.2em;
}
}
}
div.duration {
font-size: smaller;
padding-left: 1em;
margin-top: 1em;
}
}
}
// exceptions for flex-bloc in concerned-groups
//// ACTIVITY SHOW AND FORM PAGES
// Exceptions for flex-bloc in concerned-groups
div.flex-bloc.concerned-groups {
margin-top: 1em;
div.item-bloc {
@@ -130,7 +79,6 @@ div.flex-bloc.concerned-groups {
}
}
/// CHILL ENTITY RENDER BOX
.chill-entity {
@@ -0,0 +1,16 @@
div.chill-dropzone__below-zone {
a.btn-delete {
display: none;
}
}
// do it in js does not work
// document.addEventListener('DOMContentLoaded', e => {
// const dropzoneBelow = document.querySelectorAll('div.chill-dropzone__below-zone');
// dropzoneBelow.forEach(
// d => {
// const a = d.querySelector('a.btn-delete');
// d.removeChild(a);
// }
// )
// });
@@ -1,17 +1,21 @@
<template>
<concerned-groups></concerned-groups>
<social-issues-acc></social-issues-acc>
<concerned-groups v-if="hasPerson"></concerned-groups>
<social-issues-acc v-if="hasSocialIssues"></social-issues-acc>
<location v-if="hasLocation"></location>
</template>
<script>
import ConcernedGroups from './components/ConcernedGroups.vue';
import SocialIssuesAcc from './components/SocialIssuesAcc.vue';
import Location from './components/Location.vue';
export default {
name: "App",
props: ['hasSocialIssues', 'hasLocation', 'hasPerson'],
components: {
ConcernedGroups,
SocialIssuesAcc
SocialIssuesAcc,
Location
}
}
</script>
@@ -1,18 +1,61 @@
import { getSocialIssues } from 'ChillPersonAssets/vuejs/AccompanyingCourse/api.js';
import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods';
/*
* Load socialActions by socialIssue (id)
*/
const getSocialActionByIssue = (id) => {
const getSocialActionByIssue = (id) => {
const url = `/api/1.0/person/social/social-action/by-social-issue/${id}.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
throw Error('Error with request resource response');
});
};
const getLocations = () => fetchResults('/api/1.0/main/location.json');
const getLocationTypes = () => fetchResults('/api/1.0/main/location-type.json');
const getUserCurrentLocation =
() => fetch('/api/1.0/main/user-current-location.json')
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
/*
* Load Location Type by defaultFor
* @param {string} entity - can be "person" or "thirdparty"
*/
const getLocationTypeByDefaultFor = (entity) => {
return getLocationTypes().then(results =>
results.filter(t => t.defaultFor === entity)[0]
);
};
const postLocation = (body) => {
const url = `/api/1.0/main/location.json`;
return fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(body)
})
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
export {
getSocialIssues,
getSocialActionByIssue
getSocialActionByIssue,
getLocations,
getLocationTypes,
getLocationTypeByDefaultFor,
postLocation,
getUserCurrentLocation
};
@@ -1,45 +1,52 @@
<template>
<teleport to="#add-persons">
<teleport to="#add-persons" v-if="isComponentVisible">
<div class="flex-bloc concerned-groups" :class="getContext">
<persons-bloc
v-for="bloc in contextPersonsBlocs"
v-bind:key="bloc.key"
v-bind:bloc="bloc"
v-bind:setPersonsInBloc="setPersonsInBloc">
v-for="bloc in contextPersonsBlocs"
v-bind:key="bloc.key"
v-bind:bloc="bloc"
v-bind:blocWidth="getBlocWidth"
v-bind:setPersonsInBloc="setPersonsInBloc">
</persons-bloc>
</div>
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
<ul class="list-suggest add-items inline">
<li v-for="(p, i) in suggestedEntities" @click="addSuggestedEntity(p)" :key="`suggestedEntities-${i}`">
<person-text v-if="p.type === 'person'" :person="p"></person-text>
<span v-else>{{ p.text }}</span>
</li>
</ul>
</div>
<div v-if="getContext === 'accompanyingCourse' && filterSuggestedPersons.length > 0">
<ul>
<li v-for="p in filterSuggestedPersons" @click="addNewPerson(p)">
{{ p.text }}
</li>
</ul>
</div>
<ul class="record_actions">
<li class="add-persons">
<add-persons
buttonTitle="activity.add_persons"
modalTitle="activity.add_persons"
v-bind:key="addPersons.key"
v-bind:options="addPersonsOptions"
@addNewPersons="addNewPersons"
ref="addPersons">
</add-persons>
</li>
</ul>
<add-persons
buttonTitle="activity.add_persons"
modalTitle="activity.add_persons"
v-bind:key="addPersons.key"
v-bind:options="addPersons.options"
@addNewPersons="addNewPersons"
ref="addPersons">
</add-persons>
</teleport>
</teleport>
</template>
<script>
import { mapState, mapGetters } from 'vuex';
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
import PersonsBloc from './ConcernedGroups/PersonsBloc.vue';
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
export default {
name: "ConcernedGroups",
components: {
AddPersons,
PersonsBloc
PersonsBloc,
PersonText
},
data() {
return {
@@ -52,35 +59,35 @@ export default {
{ key: 'personsAssociated',
title: 'activity.bloc_persons_associated',
persons: [],
included: false
included: window.activity ? window.activity.activityType.personsVisible !== 0 : true
},
{ key: 'personsNotAssociated',
title: 'activity.bloc_persons_not_associated',
persons: [],
included: false
included: window.activity ? window.activity.activityType.personsVisible !== 0 : true
},
{ key: 'thirdparty',
title: 'activity.bloc_thirdparty',
persons: [],
included: true
included: window.activity ? window.activity.activityType.thirdPartiesVisible !== 0 : true
},
{ key: 'users',
title: 'activity.bloc_users',
persons: [],
included: true
included: window.activity ? window.activity.activityType.usersVisible !== 0 : true
},
],
addPersons: {
key: 'activity',
options: {
type: ['person', 'thirdparty', 'user'], // TODO add 'user'
priority: null,
uniq: false,
}
key: 'activity'
}
}
},
computed: {
isComponentVisible() {
return window.activity
? (window.activity.activityType.personsVisible !== 0 || window.activity.activityType.thirdPartiesVisible !== 0 || window.activity.activityType.usersVisible !== 0)
: true
},
...mapState({
persons: state => state.activity.persons,
thirdParties: state => state.activity.thirdParties,
@@ -88,14 +95,41 @@ export default {
accompanyingCourse: state => state.activity.accompanyingPeriod
}),
...mapGetters([
'filterSuggestedPersons'
'suggestedEntities'
]),
getContext() {
return (this.accompanyingCourse) ? "accompanyingCourse" : "person";
},
contextPersonsBlocs() {
return this.personsBlocs.filter(bloc => bloc.included !== false);
}
},
addPersonsOptions() {
let optionsType = [];
if (window.activity) {
if (window.activity.activityType.personsVisible !== 0) {
optionsType.push('person')
}
if (window.activity.activityType.thirdPartiesVisible !== 0) {
optionsType.push('thirdparty')
}
if (window.activity.activityType.usersVisible !== 0) {
optionsType.push('user')
}
} else {
optionsType = ['person', 'thirdparty', 'user'];
}
return {
type: optionsType,
priority: null,
uniq: false,
button: {
size: 'btn-sm'
}
}
},
getBlocWidth() {
return Math.round(100/(this.contextPersonsBlocs.length)) + '%';
}
},
mounted() {
this.setPersonsInBloc();
@@ -165,7 +199,7 @@ export default {
},
addNewPersons({ selected, modal }) {
console.log('@@@ CLICK button addNewPersons', selected);
selected.forEach(function(item) {
selected.forEach((item) => {
this.$store.dispatch('addPersonsInvolved', item);
}, this
);
@@ -173,7 +207,7 @@ export default {
modal.showModal = false;
this.setPersonsInBloc();
},
addNewPerson(person) {
addSuggestedEntity(person) {
this.$store.dispatch('addPersonsInvolved', { result: person, type: 'person' });
this.setPersonsInBloc();
},
@@ -1,26 +1,29 @@
<template>
<li>
<span class="badge bg-primary" :title="person.text">
<span :title="person.text" @click.prevent="$emit('remove', person)">
<span class="chill_denomination">
{{ textCutted }}
<person-text :person="person" :isCut="true"></person-text>
</span>
<a class="fa fa-fw fa-times"
@click.prevent="$emit('remove', person)">
</a>
</span>
</li>
</template>
<script>
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
export default {
name: "PersonBadge",
props: ['person'],
computed: {
textCutted() {
let more = (this.person.text.length > 15) ?'…' : '';
return this.person.text.slice(0,15) + more;
}
components: {
PersonText
},
// computed: {
// textCutted() {
// let more = (this.person.text.length > 15) ?'…' : '';
// return this.person.text.slice(0,15) + more;
// }
// },
emits: ['remove'],
}
</script>
@@ -1,11 +1,11 @@
<template>
<div class="item-bloc">
<div class="item-bloc" :style="{ 'flex-basis': blocWidth }">
<div class="item-row">
<div class="item-col">
<h4>{{ $t(bloc.title) }}</h4>
</div>
<div class="item-col">
<ul class="list-content">
<ul class="list-suggest remove-items">
<person-badge
v-for="person in bloc.persons"
v-bind:key="person.id"
@@ -25,7 +25,7 @@ export default {
components: {
PersonBadge
},
props: ['bloc', 'setPersonsInBloc'],
props: ['bloc', 'setPersonsInBloc', 'blocWidth'],
methods: {
removePerson(item) {
console.log('@@ CLICK remove person: item', item);
@@ -0,0 +1,77 @@
<template>
<teleport to="#location">
<div class="mb-3 row">
<label :class="locationClassList">
{{ $t("activity.location") }}
</label>
<div class="col-sm-8">
<VueMultiselect
name="selectLocation"
id="selectLocation"
label="name"
track-by="id"
open-direction="top"
:multiple="false"
:searchable="true"
:placeholder="$t('activity.choose_location')"
:custom-label="customLabel"
:select-label="$t('multiselect.select_label')"
:deselect-label="$t('multiselect.deselect_label')"
:selected-label="$t('multiselect.selected_label')"
:options="availableLocations"
group-values="locations"
group-label="locationGroup"
v-model="location"
>
</VueMultiselect>
<new-location v-bind:availableLocations="availableLocations"></new-location>
</div>
</div>
</teleport>
</template>
<script>
import { mapState, mapGetters } from "vuex";
import VueMultiselect from "vue-multiselect";
import NewLocation from "./Location/NewLocation.vue";
export default {
name: "Location",
components: {
NewLocation,
VueMultiselect,
},
data() {
return {
locationClassList:
`col-form-label col-sm-4 ${document.querySelector('input#chill_activitybundle_activity_location').getAttribute('required') ? 'required' : ''}`,
}
},
computed: {
...mapState(["activity", "availableLocations"]),
...mapGetters(["suggestedEntities"]),
location: {
get() {
return this.activity.location;
},
set(value) {
this.$store.dispatch("updateLocation", value);
},
},
},
methods: {
labelAccompanyingCourseLocation(value) {
return `${value.address.text} (${value.locationType.title.fr})`
},
customLabel(value) {
return value.locationType
? value.name
? value.name === '__AccompanyingCourseLocation__'
? this.labelAccompanyingCourseLocation(value)
: `${value.name} (${value.locationType.title.fr})`
: value.locationType.title.fr
: '';
},
},
};
</script>

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