Compare commits

...

380 Commits

Author SHA1 Message Date
1e996ce230 onTheFly with hardcoded data. needs to be changed when endpoint is created 2021-08-27 17:26:59 +02:00
4ee67869bd style fixes requestor + multiline option for thirdpartyrenderbox 2021-08-20 17:53:48 +02:00
8bcd69c5ec requestor styling fixed + button added. problem with removing requestor though... 2021-08-20 16:55:41 +02:00
badf632a8a #134 fixes address multiline 2021-08-20 16:55:04 +02:00
7363092d51 #134 fixes show button for thirdparty 2021-08-20 16:52:35 +02:00
698514ef12 #192 custom-zone added + no_data message 2021-08-20 14:47:33 +02:00
55c34c2583 #134 fix dynamic URL to go to person or thirdparty file 2021-08-20 11:06:11 +02:00
3e27589cca #134 hLevel fixed 2021-08-20 10:37:46 +02:00
52469d995a onTheFly modal, edit button changed to show person file 2021-08-19 21:07:37 +02:00
b4234ddc58 class made dynamic with correct hLevel option 2021-08-19 21:06:30 +02:00
bb471fd4af AccompanyingCourse: fix errors with renderbox into Resources 2021-08-19 19:41:16 +02:00
fdd08905a8 init new twig block_post_menu 2021-08-19 19:40:32 +02:00
755812ae3c fix buttonLocation deleted from last merge 2021-08-19 17:16:52 +02:00
3602b0d097 requestor import fix alias 2021-08-19 16:50:08 +02:00
5dc92ed5bd Merge branch 'ameliorations_composants_vue' of gitlab.com:Chill-Projet/chill-bundles into ameliorations_composants_vue 2021-08-19 16:21:11 +02:00
d61dbaed91 move vue thirdparty components in ChillThirdPartyBundle assets 2021-08-19 16:01:23 +02:00
9ac72a21d1 adding alias ChillThirdPartyAssets 2021-08-19 15:45:29 +02:00
fd8f4a98c0 vue Address: fix ShowAddress multiline option 2021-08-19 15:41:54 +02:00
2394895ccb Merge branch 'ameliorations_composants_vue' of gitlab.com:Chill-Projet/chill-bundles into ameliorations_composants_vue 2021-08-19 15:07:43 +02:00
6ca35d5a18 requestor adapted to use PersonRenderBox or ThirdPartyRenderBox 2021-08-19 14:47:41 +02:00
6253927e2e Merge branch 'ameliorations_composants_vue' into improve_ux 2021-08-19 14:31:20 +02:00
0f87d77896 Merge branch 102_activites_annexes into 'improve_ux' 2021-08-19 14:08:23 +02:00
8b50e5bd62 comment TODO 2021-08-19 12:41:38 +02:00
f490fdd37c batch remove 'Bravo' 2021-08-19 12:41:38 +02:00
7ffdf4cb1f render_box person and thirdparty: fix bug customOptions with 'replace' 2021-08-19 12:41:38 +02:00
801e897a38 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-08-19 12:40:05 +02:00
21db8674e7 thirdparty: replace macro address by render_box 2021-08-19 12:38:07 +02:00
de7322464b deathdate fix in personrenderbox, in case there is a deathdate 2021-08-19 12:32:26 +02:00
90cfcd0569 ThirdPartyRenderBox created and old view replaced 2021-08-19 12:31:38 +02:00
4a0ffd2cba flex-table taken out of for-loop 2021-08-19 12:29:08 +02:00
3e9d96368d style added to create space between streetname and city + margin of flex-table fixed 2021-08-19 12:26:00 +02:00
227d627ad5 Merge branch 110_extend_thirdparty into 'master' 2021-08-19 12:19:00 +02:00
c7a2bbfc1d remove dump debug 2021-08-19 12:17:16 +02:00
1aa77bd1c4 AccompanyingCourse: uniformity of styles 2021-08-18 22:36:02 +02:00
39e8af48b4 #198 issue fixes: mostly template fixes and translations 2021-08-18 22:31:43 +02:00
9a1f56a820 [Aside activity] Temporarily remove the link to aside activities 2021-08-18 21:23:04 +02:00
d652771af0 CourseLocation: fix errors 2021-08-18 20:10:43 +02:00
9d655d92f2 CourseLocation: add message if no address 2021-08-18 17:45:37 +02:00
9e51717984 Merge branch accourse_confirmation into 'master' 2021-08-18 17:23:27 +02:00
a6b360c193 setup of ThirdPartyRenderBox 2021-08-18 17:20:57 +02:00
42b9e25403 some todo's added in comment + most href's made dynamic 2021-08-18 17:20:17 +02:00
403922c631 AccompanyingCourse, change blocs order (location in second position) 2021-08-18 17:10:37 +02:00
53fe90adc3 AccompanyingCourse: check if conditions of confirmation are met, or display alert 2021-08-18 16:54:22 +02:00
41fe95c80f fix display styles bugs 2021-08-18 16:54:22 +02:00
28435940f1 AccompanyingCourse api errorMsg 2021-08-18 16:53:06 +02:00
34e1a9b748 address added to personrenderbox w/ ShowAddress. Adapted to include a multiline option 2021-08-18 16:22:38 +02:00
097ad3a364 fix return type of class 2021-08-18 09:56:48 +02:00
816d860f4a Merge branch 'fixtures/fix-loading-people' into 'master'
Fixtures/fix loading people

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

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

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

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

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

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

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

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

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

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

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

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

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

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

See merge request Chill-Projet/chill-bundles!111
2021-07-22 15:20:45 +00:00
2699d48533 Fix tests after introduction of bootstrap 2021-07-22 15:20:45 +00:00
a559589883 add isLeaf condition on ThirdParty form Type 2021-07-22 16:34:07 +02:00
d81f5bafe3 adding content classes + divers 2021-07-22 13:19:25 +02:00
c6a3f59d87 household members editor: make buttons visibles 2021-07-22 12:19:35 +02:00
ff671ded9c move alert-with-actions sass, remove unused alert-first-child 2021-07-22 11:37:05 +02:00
678c7d18b4 fix data-toggle collapse mechanism
+ cleaning links in theses files
2021-07-22 11:34:37 +02:00
f73f515fb3 fix sass variable 2021-07-22 10:25:17 +02:00
afd4ac27ea search page, content position 2021-07-22 09:59:13 +02:00
ea734e2a9e fix menu context class 2021-07-20 15:46:20 +02:00
587da94645 adapt Thirdparty form and templates 2021-07-20 15:34:28 +02:00
3f9e215ea5 adding fixtures for new thirdparty fields (choice lists) 2021-07-19 17:18:36 +02:00
732390f704 add new fields in thirdparty entity 2021-07-19 16:11:25 +02:00
25b00296ca adapt thirdparty templates 2021-07-16 17:01:32 +02:00
1e626d573f Merge branch 'bootstrap5' into 110_extend_thirdparty 2021-07-16 13:29:01 +02:00
3ee676600e adding twig extensions to select how many items per page
* twig anchor: {{ chill_items_per_page(pagination) }}
* select field changed with javascript event listener
2021-07-16 13:23:10 +02:00
d2c631ae20 prepare thirdparty index template 2021-07-16 11:07:52 +02:00
8462538123 adapt pagination to bootstrap, add a short pagination variant 2021-07-16 09:51:15 +02:00
645252fd85 start CRUD controllers asideActivityBundle 2021-07-15 16:15:46 +02:00
ea2d6eac7b AsideActivityType entity changed to AsideActivityCategory + building forms for both entities 2021-07-07 16:24:41 +02:00
e7c76734a6 start form 2021-07-06 15:56:55 +02:00
8389afb4a8 first migration: creation entities AsideActivity(Type) 2021-07-06 15:56:21 +02:00
fc074c2f1a changes to composer.json 2021-07-06 14:11:06 +02:00
eff1d6e797 start of AsideActivity entities 2021-07-06 14:10:36 +02:00
10de2d7966 start of AsideActivity entities 2021-07-06 14:08:44 +02:00
c27268443c start creation AsideActivity bundle 2021-07-05 17:40:21 +02:00
Pol Dellaiera
d71c3f310e (to rebase/fixup later) Fix documentation. 2021-06-24 16:01:41 +02:00
Pol Dellaiera
4a2ada784a (to rebase/fixup later) Let Goal be associated to a Result. 2021-06-24 15:57:03 +02:00
Pol Dellaiera
3b5ef53b9b (to rebase/fixup later) Let Result be associated to a SocialAction. 2021-06-24 15:46:04 +02:00
Pol Dellaiera
18d0ad67d6 (to rebase/fixup later) Update command based on feedback. 2021-06-24 15:25:27 +02:00
Pol Dellaiera
ea1c12da64 (to rebase/fixup later) Fields must be nullable for import to success. 2021-06-24 15:24:58 +02:00
Pol Dellaiera
141aabcddc feat: Add new command. 2021-06-24 11:37:00 +02:00
Pol Dellaiera
6e37e7feac Let repositories implements ObjectRepository. 2021-06-23 23:13:16 +02:00
Pol Dellaiera
df1f44d814 Let SocialAction::defaultNotificationDelay be nullable. 2021-06-23 23:11:53 +02:00
Pol Dellaiera
dc26ca7e77 Add missing getId() method. 2021-06-23 23:11:53 +02:00
Pol Dellaiera
2667867bd0 Update composer - Bump league/php. 2021-06-23 23:11:53 +02:00
Pol Dellaiera
5ddc0e7a53 Simplify loading of Symfony commands. 2021-06-23 23:11:53 +02:00
738 changed files with 18185 additions and 21900 deletions

View File

@@ -5,11 +5,13 @@ image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
cache: cache:
paths: paths:
- tests/app/vendor/ - tests/app/vendor/
- .composer
before_script: before_script:
# add extensions to postgres # 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;" - 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 # Install and run Composer
- mkdir -p $COMPOSER_HOME
- curl -sS https://getcomposer.org/installer | php - curl -sS https://getcomposer.org/installer | php
- php -d memory_limit=2G composer.phar install - php -d memory_limit=2G composer.phar install
- php tests/app/bin/console doctrine:migrations:migrate -n - php tests/app/bin/console doctrine:migrations:migrate -n
@@ -34,6 +36,10 @@ variables:
REDIS_HOST: redis REDIS_HOST: redis
REDIS_PORT: 6379 REDIS_PORT: 6379
REDIS_URL: redis://redis:6379 REDIS_URL: redis://redis:6379
# change vendor dir to make the app install into tests/apps
COMPOSER_VENDOR_DIR: tests/app/vendor
# cache some composer data
COMPOSER_HOME: .composer
# Run our tests # Run our tests

View File

@@ -3,7 +3,10 @@
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"type": "library", "type": "library",
"description": "Most used bundles for chill-project", "description": "Most used bundles for chill-project",
"keywords": ["chill", "social worker"], "keywords": [
"chill",
"social worker"
],
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle", "Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle",
@@ -16,12 +19,14 @@
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle",
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle", "Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle" "Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle",
"Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle/src",
"Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle"
} }
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {
"App\\": "tests/app/src/" "App\\": "tests/app/src/"
} }
}, },
"require": { "require": {
@@ -52,7 +57,7 @@
"knplabs/knp-time-bundle": "^1.12", "knplabs/knp-time-bundle": "^1.12",
"symfony/intl": "4.*", "symfony/intl": "4.*",
"symfony/swiftmailer-bundle": "^3.5", "symfony/swiftmailer-bundle": "^3.5",
"league/csv": "^9.6", "league/csv": "^9.7.1",
"phpoffice/phpspreadsheet": "^1.16", "phpoffice/phpspreadsheet": "^1.16",
"symfony/browser-kit": "^5.2", "symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2", "symfony/css-selector": "^5.2",
@@ -84,7 +89,6 @@
} }
}, },
"config": { "config": {
"vendor-dir": "tests/app/vendor", "bin-dir": "bin"
"bin-dir": "bin"
} }
} }

View File

@@ -28,7 +28,7 @@ Then, render the pagination using the dedicated twig function.
.. code-block:: html+twig .. code-block:: html+twig
{% extends "ChillPersonBundle::layout.html.twig" %} {% extends "@ChillPerson/Person/layout.html.twig" %}
{% block title 'Item list'|trans %} {% block title 'Item list'|trans %}

View File

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

View File

@@ -22,6 +22,7 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt
'entityRef' => 'activity_gerard depardieu', 'entityRef' => 'activity_gerard depardieu',
'sender' => 'center a_social', 'sender' => 'center a_social',
'addressees' => [ 'addressees' => [
'center a_social',
'center a_administrative', 'center a_administrative',
'center a_direction', 'center a_direction',
'multi_center' 'multi_center'

View File

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

View File

@@ -0,0 +1,129 @@
// Access to Bootstrap variables and mixins
@import '~ChillMainAssets/module/bootstrap/shared';
// activity creation first step: select type page
div.new-activity-select-type {
div.activity-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 12px;
div.bloc {
width: 200px;
align-self: flex-end;
height: 140px;
display: flex;
justify-content: center;
align-items: center;
}
}
}
// 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: 27%;
}
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.details {
flex-direction: row;
& > div.item-col {
justify-content: flex-start;
align-self: center;
&:nth-child(1) {
flex-grow: 1; flex-shrink: 0; flex-basis: 30%;
}
&:nth-child(2) {
flex-grow: 0; flex-shrink: 1; flex-basis: 70%;
}
&:only-child {
flex-grow: 0; flex-shrink: 0; flex-basis: 100%;
& > div.concerned-groups {
flex-grow: 0; flex-shrink: 0; flex-basis: 100%;
display: flex;
flex-direction: column; // TODO pas fini
div.group {
flex-grow: 1; flex-shrink: 0; flex-basis: 30%;
h4 {}
ul.list-content {
li {
display: inline;
}
}
}
}
}
}
div.concerned-groups {
font-size: 85%;
h4 {
text-transform: uppercase;
}
}
}
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
div.flex-bloc.concerned-groups {
margin-top: 1em;
div.item-bloc {
flex-grow: 0; flex-shrink: 0; flex-basis: 25%; //4 blocs
ul.list-content {
list-style-type: none;
padding-left: 0;
li {
margin-bottom: 0.2em;
a {
color: $white;
cursor: pointer;
&:hover {
color: #ffffffab;
}
}
}
}
}
&.person div.item-bloc {
flex-basis: 33%; //3 blocs
}
}

View File

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

View File

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

View File

@@ -1,130 +0,0 @@
@import '~ChillMainAssets/modules/bootstrap/bootstrap';
//@import '~ChillMainSass/custom/mixins/entity';
//.chill-entity.chill-entity__activity-reason {
// @include entity($chill-pink, white);
//}
.activity {
color: $chill-green;
}
// exceptions for flex-bloc in concerned-groups
div.flex-bloc.concerned-groups {
margin-top: 1em;
div.item-bloc {
flex-grow: 0; flex-shrink: 0; flex-basis: 25%; //4 blocs
ul.list-content {
list-style-type: none;
padding-left: 0;
li {
margin-bottom: 0.2em;
a {
color: white;
cursor: pointer;
&:hover {
color: #ffffffab;
}
}
}
}
}
&.person div.item-bloc {
flex-basis: 33%; //3 blocs
}
}
// exceptions for flex-table in list-records
div.flex-table.list-records {
div.item-bloc {
div.item-row.main {
div.item-col {
&:first-child {
flex-basis: 27%;
}
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: var(--chill-orange);
}
li.social-actions .badge-primary {
background-color: var(--chill-green);
}
}
}
}
div.item-row.details {
flex-direction: row;
& > div.item-col {
justify-content: flex-start;
align-self: center;
&:nth-child(1) {
flex-grow: 1; flex-shrink: 0; flex-basis: 30%;
}
&:nth-child(2) {
flex-grow: 0; flex-shrink: 1; flex-basis: 70%;
}
&:only-child {
flex-grow: 0; flex-shrink: 0; flex-basis: 100%;
& > div.concerned-groups {
flex-grow: 0; flex-shrink: 0; flex-basis: 100%;
display: flex;
flex-direction: column; // TODO pas fini
div.group {
flex-grow: 1; flex-shrink: 0; flex-basis: 30%;
h4 {}
ul.list-content {
li {
display: inline;
}
}
}
}
}
}
div.concerned-groups {
font-size: 85%;
h4 {
text-transform: uppercase;
}
}
}
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;
}
}
div.activity-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 12px;
div.bloc {
width: 200px;
align-self: flex-end;
height: 140px;
display: flex;
justify-content: center;
align-items: center;
}
}

View File

@@ -60,7 +60,10 @@
<li> <li>
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}"> <a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
<span class="badge bg-primary"> <span class="badge bg-primary">
{{ item|chill_entity_render_box({'only_denomination': true}) }} {{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
</span> </span>
</a> </a>
</li> </li>
@@ -72,7 +75,7 @@
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% if (with_display == 'row') %} {% if (with_display == 'row') %}
<div class="concerned-groups"> <div class="concerned-groups">
{% for bloc in blocs %} {% for bloc in blocs %}
@@ -84,7 +87,10 @@
<li> <li>
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}"> <a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
<span class="badge bg-primary"> <span class="badge bg-primary">
{{ item|chill_entity_render_box({'only_denomination': true}) }} {{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
</span> </span>
</a> </a>
</li> </li>

View File

@@ -54,7 +54,7 @@
{{ form_row(edit_form.date) }} {{ form_row(edit_form.date) }}
{% endif %} {% endif %}
.. location {# TODO .. location #}
{%- if edit_form.durationTime is defined -%} {%- if edit_form.durationTime is defined -%}
{{ form_row(edit_form.durationTime) }} {{ form_row(edit_form.durationTime) }}
@@ -65,7 +65,7 @@
{% endif %} {% endif %}
{%- if edit_form.comment is defined -%} {%- if edit_form.comment is defined -%}
.. public and private {# TODO .. public and private #}
{{ form_row(edit_form.comment) }} {{ form_row(edit_form.comment) }}
{% endif %} {% endif %}
@@ -77,7 +77,7 @@
{{ form_row(edit_form.attendee) }} {{ form_row(edit_form.attendee) }}
{% endif %} {% endif %}
.. status {# TODO .. status #}
{% set person_id = null %} {% set person_id = null %}
{% if entity.person %} {% if entity.person %}

View File

@@ -6,20 +6,16 @@
{% block content %} {% block content %}
<div class="activity-edit"> <div class="activity-edit">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
<div id="activity"></div> {# <=== vue component #} <div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:edit.html.twig' %} {% include 'ChillActivityBundle:Activity:edit.html.twig' %}
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ parent() }} {{ parent() }}
{{ encore_entry_link_tags('async_upload') }} {{ encore_entry_link_tags('mod_async_upload') }}
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) { window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]', chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
@@ -32,6 +28,6 @@
{% block css %} {% block css %}
{{ parent() }} {{ parent() }}
{{ encore_entry_link_tags('async_upload') }} {{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }} {{ encore_entry_link_tags('vue_activity') }}
{% endblock %} {% endblock %}

View File

@@ -22,19 +22,15 @@
{% block personcontent %} {% block personcontent %}
<div class="activity-edit"> <div class="activity-edit">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
<div id="activity"></div> {# <=== vue component #} <div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:edit.html.twig' %} {% include 'ChillActivityBundle:Activity:edit.html.twig' %}
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ encore_entry_link_tags('async_upload') }} {{ encore_entry_link_tags('mod_async_upload') }}
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) { window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]', chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
@@ -46,6 +42,6 @@
{% endblock %} {% endblock %}
{% block css %} {% block css %}
{{ encore_entry_link_tags('async_upload') }} {{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }} {{ encore_entry_link_tags('vue_activity') }}
{% endblock %} {% endblock %}

View File

@@ -1,197 +1,163 @@
{% set person_id = null %} <div class="activity-list context-{{ context }}">
{% if person %}
{% set person_id = person.id %}
{% endif %}
{% set accompanying_course_id = null %} {% if activities|length == 0 %}
{% if accompanyingCourse %} <p class="chill-no-data-statement">
{% set accompanying_course_id = accompanyingCourse.id %} {{ "There isn't any activities."|trans }}
{% endif %} <a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-sm btn-create"></a>
</p>
<h2>{{ 'Activity list' |trans }}</h2> {% else %}
<div class="flex-table">
{% for activity in activities %}
{% set t = activity.type %}
<div class="item-bloc">
<div class="item-row main">
<div class="item-col">
{% if activities|length == 0 %} {% if activity.date %}
<p class="chill-no-data-statement"> <h3>{{ activity.date|format_date('long') }}</h3>
{{ "There isn't any activities."|trans }}
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create button-small"></a>
</p>
{% else %}
<div class="flex-table list-records context-{{ context }}">
<!--
<thead>
<tr>
<th class="chill-red">{{'Date' | trans }}</th>
<th class="chill-green">{{'Duration Time' | trans }}</th>
<th class="chill-orange">{{'Reasons' | trans}}</th>
<th>{{'Type' | trans}}</th>
<th>&nbsp;</th>
</tr>
</thead>
-->
{% for activity in activities %}
{% set t = activity.type %}
<div class="item-bloc">
<div class="item-row main">
<div class="item-col">
{% if activity.date %}
<h3>{{ activity.date|format_date('long') }}</h3>
{% endif %}
<div class="duration">
{% if t.durationTimeVisible > 0 %}
<p>
<i class="fa fa-fw fa-hourglass-end"></i>
{{ activity.durationTime|date('H:i') }}
</p>
{% endif %}
{% if activity.travelTime and t.travelTimeVisible %}
<p>
<i class="fa fa-fw fa-car"></i>
{{ activity.travelTime|date('H:i') }}
</p>
{% endif %}
</div>
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
<div class="accompanyingPeriodLink" style="margin-top: 1rem">
<a
href="{{ chill_path_add_return_path(
"chill_person_accompanying_course_index",
{ 'accompanying_period_id': activity.accompanyingPeriod.id }
) }}"
>
<i class="fa fa-random"></i>
{{ activity.accompanyingPeriod.id }}
</a>
</div>
{% endif %}
</div>
<div class="item-col">
<ul class="list-content">
{% if activity.user and t.userVisible %}
<li>
<b>{{ 'by'|trans }}{{ activity.user.usernameCanonical }}</b>
</li>
{% endif %}
<li>
<b>{{ activity.type.name | localize_translatable_string }}</b>
{% if activity.attendee is not null and t.attendeeVisible %}
{% if activity.attendee %}
{{ '→ ' ~ 'present'|trans|capitalize }}
{% else %}
{{ '→ ' ~ 'not present'|trans|capitalize }}
{% endif %}
{% endif %} {% endif %}
</li>
<li>
<b>{{ 'location'|trans ~ ': ' }}</b>
Domicile de l'usager
{#
{% if activity.location %}{{ activity.location }}{% endif %}
#}
</li>
{%- if t.reasonsVisible -%}
<li>
{%- if activity.reasons is empty -%}
<span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span>
{%- else -%}
{% for r in activity.reasons %}
{{ r|chill_entity_render_box }}
{% endfor %}
{%- endif -%}
</li>
{% endif %}
{%- if t.socialIssuesVisible %} <div class="duration">
<li class="social-issues"> {% if t.durationTimeVisible > 0 %}
{%- if activity.socialIssues is empty -%} <p>
<span class="chill-no-data-statement">{{ 'No social issues associated'|trans }}</span> <i class="fa fa-fw fa-hourglass-end"></i>
{%- else -%} {{ activity.durationTime|date('H:i') }}
{% for r in activity.socialIssues %} </p>
{{ r|chill_entity_render_box }} {% endif %}
{% endfor %} {% if activity.travelTime and t.travelTimeVisible %}
{%- endif -%} <p>
</li> <i class="fa fa-fw fa-car"></i>
{% endif %} {{ activity.travelTime|date('H:i') }}
</p>
{%- if t.socialActionsVisible -%} {% endif %}
<li class="social-actions"> </div>
{%- if activity.socialActions is empty -%}
<span class="chill-no-data-statement">{{ 'No social actions associated'|trans }}</span>
{%- else -%}
{% for r in activity.socialActions %}
<span class="badge bg-primary">{{ r.title|localize_translatable_string }}</span>
{% endfor %}
{%- endif -%}
</li>
{% endif %}
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
</ul> <div class="accompanyingPeriodLink" style="margin-top: 1rem">
<ul class="record_actions"> <a href="{{ chill_path_add_return_path(
<li> "chill_person_accompanying_course_index",
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-show "></a> { 'accompanying_period_id': activity.accompanyingPeriod.id }
</li> ) }}">
{# TOOD <i class="fa fa-random"></i>
{{ activity.accompanyingPeriod.id }}
</a>
</div>
{% endif %}
</div>
<div class="item-col">
<ul class="list-content">
{% if activity.user and t.userVisible %}
<li>
<b>{{ 'by'|trans }}{{ activity.user.usernameCanonical }}</b>
</li>
{% endif %}
<li>
<b>{{ activity.type.name | localize_translatable_string }}</b>
{% if activity.attendee is not null and t.attendeeVisible %}
{% if activity.attendee %}
{{ '→ ' ~ 'present'|trans|capitalize }}
{% else %}
{{ '→ ' ~ 'not present'|trans|capitalize }}
{% endif %}
{% endif %}
</li>
<li>
<b>{{ 'location'|trans ~ ': ' }}</b>
Domicile de l'usager
{#
{% if activity.location %}{{ activity.location }}{% endif %}
#}
</li>
{%- if t.reasonsVisible -%}
<li>
{%- if activity.reasons is not empty -%}
{% for r in activity.reasons %}
{{ r|chill_entity_render_box }}
{% endfor %}
{%- endif -%}
</li>
{% endif %}
{%- if t.socialIssuesVisible %}
<li class="social-issues">
{%- if activity.socialIssues is not empty -%}
{% for r in activity.socialIssues %}
{{ r|chill_entity_render_box }}
{% endfor %}
{%- endif -%}
</li>
{% endif %}
{%- if t.socialActionsVisible -%}
<li class="social-actions">
{%- if activity.socialActions is not empty -%}
{% for r in activity.socialActions %}
<span class="badge bg-primary">{{ r.title|localize_translatable_string }}</span>
{% endfor %}
{%- endif -%}
</li>
{% endif %}
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
class="btn btn-sm btn-show "></a>
</li>
{# TOOD
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %} {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
#} #}
<li> <li>
<a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-update "></a> <a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
</li> class="btn btn-sm btn-update "></a>
{# TOOD </li>
{# TOOD
{% endif %} {% endif %}
{% if is_granted('CHILL_ACTIVITY_DELETE', activity) %} {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
#} #}
<li> <li>
<a href="{{ path('chill_activity_activity_delete', { 'id': activity.id, 'person_id' : person_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete "></a> <a href="{{ path('chill_activity_activity_delete', { 'id': activity.id, 'person_id' : person_id, 'accompanying_period_id': accompanying_course_id } ) }}"
</li> class="btn btn-sm btn-delete "></a>
{# </li>
{% endif %} {#
#} {% endif %}
</ul> #}
</div> </ul>
</div> </div>
</div>
{%
if activity.comment.comment is not empty {% if activity.comment.comment is not empty
or activity.persons|length > 0 or activity.persons|length > 0
or activity.thirdParties|length > 0 or activity.thirdParties|length > 0
or activity.users|length > 0 or activity.users|length > 0
%} %}
<div class="item-row details"> <div class="item-row details">
<div class="item-col"> <div class="item-col">
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'row', 'entity': activity } %}
</div>
{% if activity.comment.comment is not empty %}
<div class="item-col">
{{ activity.comment|chill_entity_render_box({
'disable_markdown': false,
'limit_lines': 3,
'metadata': false,
}) }}
</div>
{% endif %}
</div>
{% endif %}
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'row', 'entity': activity } %}
</div> </div>
{% endfor %}
{% if activity.comment.comment is not empty %}
<div class="item-col comment">
{{ activity.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
</div>
{% endif %}
</div>
{% endif %}
</div> </div>
{% endfor %} {% endif %}
</div>
{% endif %}
{% if context != 'person' %} </div>
{# TODO set this condition in configuration #}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create">
{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>
{% endif %}

View File

@@ -5,5 +5,27 @@
{% block title %}{{ 'Activity list' |trans }}{% endblock title %} {% block title %}{{ 'Activity list' |trans }}{% endblock title %}
{% block content %} {% block content %}
{% set person_id = null %}
{% if person %}
{% set person_id = person.id %}
{% endif %}
{% set accompanying_course_id = null %}
{% if accompanyingCourse %}
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<h1>{{ 'Activity list' |trans }}</h1>
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse'} %} {% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse'} %}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create">
{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>
{% endblock %} {% endblock %}

View File

@@ -21,5 +21,27 @@
{% block title %}{{ 'Activity list' |trans }}{% endblock title %} {% block title %}{{ 'Activity list' |trans }}{% endblock title %}
{% block personcontent %} {% block personcontent %}
{% set person_id = null %}
{% if person %}
{% set person_id = person.id %}
{% endif %}
{% set accompanying_course_id = null %}
{% if accompanyingCourse %}
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<h1>{{ 'Activity list' |trans }}</h1>
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %} {% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}"
class="btn btn-create disabled" tabindex="-1" role="button" aria-disabled="true">{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>
{% endblock %} {% endblock %}

View File

@@ -55,7 +55,7 @@
{{ form_row(form.date) }} {{ form_row(form.date) }}
{% endif %} {% endif %}
.. location {# TODO .. location #}
{%- if form.durationTime is defined -%} {%- if form.durationTime is defined -%}
{{ form_row(form.durationTime) }} {{ form_row(form.durationTime) }}
@@ -66,7 +66,7 @@
{% endif %} {% endif %}
{%- if form.comment is defined -%} {%- if form.comment is defined -%}
.. public and private {# TODO .. public and private #}
{{ form_row(form.comment) }} {{ form_row(form.comment) }}
{% endif %} {% endif %}
@@ -78,13 +78,13 @@
{{ form_row(form.attendee) }} {{ form_row(form.attendee) }}
{% endif %} {% endif %}
.. status {# TODO .. status #}
<ul class="record_actions sticky-form-buttons"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a <a
class="btn btn-cancel" class="btn btn-cancel"
{%- if context == 'person' -%} {%- if context == 'person' -%}
href="{{ chill_return_path_or('chill_activity_activity_list', { 'person_id': person.id } )}}" href="{{ chill_return_path_or('chill_activity_activity_list', { 'person_id': person.id } )}}"
{%- else -%} {%- else -%}
href="{{ chill_return_path_or('chill_activity_activity_list', { 'accompanying_period_id': accompanyingCourse.id } )}}" href="{{ chill_return_path_or('chill_activity_activity_list', { 'accompanying_period_id': accompanyingCourse.id } )}}"

View File

@@ -6,32 +6,28 @@
{% block content %} {% block content %}
<div class="activity-new"> <div class="activity-new">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl"> <div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'accompanyingCourse'} %}
<div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'accompanyingCourse'} %} </div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ parent() }} {{ parent() }}
{{ encore_entry_script_tags('async_upload') }} {{ encore_entry_script_tags('mod_async_upload') }}
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) { window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]', chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]',
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}'); '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
}); });
window.activity = {{ activity_json|json_encode|raw }}; window.activity = {{ activity_json|json_encode|raw }};
</script> </script>
{{ encore_entry_script_tags('vue_activity') }} {{ encore_entry_script_tags('vue_activity') }}
{% endblock %} {% endblock %}
{% block css %} {% block css %}
{{ parent() }} {{ parent() }}
<link rel="stylesheet" href="{{ asset('build/async_upload.css') }}"/> {{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }} {{ encore_entry_link_tags('vue_activity') }}
{% endblock %} {% endblock %}

View File

@@ -6,19 +6,15 @@
{% block personcontent %} {% block personcontent %}
<div class="activity-new"> <div class="activity-new">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
<div id="activity"></div> {# <=== vue component #} <div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'person'} %} {% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'person'} %}
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ encore_entry_link_tags('async_upload') }} {{ encore_entry_link_tags('mod_async_upload') }}
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) { window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]', chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]',
@@ -30,6 +26,6 @@
{% endblock %} {% endblock %}
{% block css %} {% block css %}
{{ encore_entry_link_tags('async_upload') }} {{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }} {{ encore_entry_link_tags('vue_activity') }}
{% endblock %} {% endblock %}

View File

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

View File

@@ -8,12 +8,8 @@
{% block content -%} {% block content -%}
<div class="activity-show"> <div class="activity-show">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %} {% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %}
</div>
</div>
</div> </div>
{% endblock content %} {% endblock content %}

View File

@@ -0,0 +1,4 @@
{{ dump(notification) }}
<a href="{{ path('chill_activity_activity_show', {'id': notification.relatedEntityId }) }}">Go to Activity</a>

View File

@@ -8,12 +8,8 @@
{% block personcontent -%} {% block personcontent -%}
<div class="activity-show"> <div class="activity-show">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'person'} %} {% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'person'} %}
</div>
</div>
</div> </div>
{% endblock personcontent %} {% endblock personcontent %}

View File

@@ -1,10 +1,11 @@
// this file loads all assets from the Chill person bundle // this file loads all assets from the Chill person bundle
module.exports = function(encore, entries) { module.exports = function(encore, entries)
entries.push(__dirname + '/Resources/public/index.js'); {
entries.push(__dirname + '/Resources/public/chill/index.js');
encore.addAliases({ encore.addAliases({
ChillActivityAssets: __dirname + '/Resources/public' ChillActivityAssets: __dirname + '/Resources/public'
}); });
encore.addEntry('vue_activity', __dirname + '/Resources/public/vuejs/Activity/index.js'); encore.addEntry('vue_activity', __dirname + '/Resources/public/vuejs/Activity/index.js');
}; };

View File

@@ -1,4 +1,4 @@
services: services:
chill.activity.security.authorization.activity_voter: chill.activity.security.authorization.activity_voter:
class: Chill\ActivityBundle\Security\Authorization\ActivityVoter class: Chill\ActivityBundle\Security\Authorization\ActivityVoter
arguments: arguments:
@@ -6,7 +6,7 @@ services:
tags: tags:
- { name: security.voter } - { name: security.voter }
- { name: chill.role } - { name: chill.role }
chill.activity.security.authorization.activity_stats_voter: chill.activity.security.authorization.activity_stats_voter:
class: Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter class: Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter
arguments: arguments:
@@ -14,8 +14,8 @@ services:
tags: tags:
- { name: security.voter } - { name: security.voter }
- { name: chill.role } - { name: chill.role }
chill.activity.timeline: chill.activity.timeline:
class: Chill\ActivityBundle\Timeline\TimelineActivityProvider class: Chill\ActivityBundle\Timeline\TimelineActivityProvider
arguments: arguments:
@@ -33,3 +33,8 @@ services:
autoconfigure: true autoconfigure: true
resource: '../Menu/' resource: '../Menu/'
tags: ['chill.menu_builder'] tags: ['chill.menu_builder']
Chill\ActivityBundle\Notification\:
autowire: true
autoconfigure: true
resource: '../Notification'

View File

@@ -81,9 +81,9 @@ activity:
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"' '%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'
#controller #controller
'Success : activity created!': Bravo ! L'activité a été créée. 'Success : activity created!': L'activité a été créée.
'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'activité n'a pas été créée. 'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'activité n'a pas été créée.
'Success : activity updated!': Bravo ! L'activité a été mise à jour. 'Success : activity updated!': L'activité a été mise à jour.
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour. 'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
# ROLES # ROLES

View File

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

View File

@@ -0,0 +1,3 @@
# Aside activities module
This module offers the possibility to add extra curricular activities per user (eg. administrative tasks, formation, meetings) not immediately related to client support.

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Chill\AsideActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillAsideActivityBundle extends Bundle
{
}

View File

@@ -0,0 +1,14 @@
<?php
namespace Chill\AsideActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
/**
* Class AsideActivityBundle
*/
class AsideActivityCategoryController extends CRUDController
{
}

View File

@@ -0,0 +1,14 @@
<?php
namespace Chill\AsideActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
/**
* Class AsideActivityBundle
*/
class AsideActivityController extends CRUDController
{
}

View File

@@ -0,0 +1,107 @@
<?php
/**
* 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\AsideActivityBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
final class ChillAsideActivityExtension extends Extension implements PrependExtensionInterface
{
/**
* {@inheritdoc}
*
* @phpstan-ignore-next-line
*/
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
// $loader->load('services.yaml');
$loader->load('services/form.yaml');
}
public function prepend(ContainerBuilder $container)
{
$this->prependRoute($container);
$this->prependCruds($container);
}
protected function prependRoute(ContainerBuilder $container)
{
//declare routes for task bundle
$container->prependExtensionConfig('chill_main', array(
'routing' => array(
'resources' => array(
'@ChillAsideActivityBundle/config/routes.yaml',
)
)
));
}
protected function prependCruds(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\AsideActivityBundle\Entity\AsideActivityCategory::class,
'name' => 'aside_activity_category',
'base_path' => '/admin/asideactivity/category',
'form_class' => \Chill\AsideActivityBundle\Form\AsideActivityCategoryType::class,
'controller' => \Chill\AsideActivityBundle\Controller\AsideActivityCategoryController::class,
'actions' => [
'index' => [
'template' => '@ChillAsideActivity/asideActivityCategory/index.html.twig',
'role' => 'ROLE_ADMIN'
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillAsideActivity/asideActivityCategory/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillAsideActivity/asideActivityCategory/edit.html.twig',
]
]
],
[
'class' => \Chill\AsideActivityBundle\Entity\AsideActivity::class,
'name' => 'aside_activity',
'base_path' => '/asideactivity',
'form_class' => \Chill\AsideActivityBundle\Form\AsideActivityFormType::class,
'controller' => \Chill\AsideActivityBundle\Controller\AsideActivityController::class,
'actions' => [
'index' => [
'template' => '@ChillAsideActivity/asideActivity/list.html.twig',
'role' => 'ROLE_USER'
],
'new' => [
'role' => 'ROLE_USER',
'template' => '@ChillAsideActivity/asideActivity/new.html.twig',
],
'view' => [
'role' => 'ROLE_USER',
'template' => '@ChillAsideActivity/asideActivity/view.html.twig',
],
'edit' => [
'role' => 'ROLE_USER',
'template' => '@ChillAsideActivity/asideActivity/edit.html.twig',
],
'delete' => [
'role' => 'ROLE_USER',
'template' => '@ChillAsideActivity/asideActivity/delete.html.twig',
]
]
],
]
]);
}
}

View File

@@ -0,0 +1,209 @@
<?php
declare(strict_types=1);
namespace Chill\AsideActivityBundle\Entity;
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(schema="chill_asideactivity")
*/
final class AsideActivity implements TrackUpdateInterface, TrackCreationInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id;
/**
* @ORM\ManyToOne(targetEntity=AsideActivityCategory::class, inversedBy="asideActivities")
* @ORM\JoinColumn(nullable=false)
*/
private $type;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private \Chill\MainBundle\Entity\User $createdBy;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=User::class)
*/
private \Chill\MainBundle\Entity\User $updatedBy;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
* @Assert\NotBlank()
*/
private \Chill\MainBundle\Entity\User $agent;
/**
* @ORM\Column(type="datetime")
*/
private $date;
/**
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTimeInterface $duration = null;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $location;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $note;
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?AsideActivityCategory
{
return $this->type;
}
public function setType(?AsideActivityCategory $type): self
{
$this->type = $type;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function setCreatedBy(?User $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedBy(): ?User
{
return $this->updatedBy;
}
public function setUpdatedBy(?User $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getAgent(): ?User
{
return $this->agent;
}
public function setAgent(?User $agent): self
{
$this->agent = $agent;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getDuration(): ?\DateTimeInterface
{
return $this->duration;
}
public function setDuration(?\DateTimeInterface $duration): self
{
$this->duration = $duration;
return $this;
}
public function getLocation(): ?string
{
return $this->location;
}
public function setLocation(?string $location): self
{
$this->location = $location;
return $this;
}
public function getNote(): ?string
{
return $this->note;
}
public function setNote(?string $note): self
{
$this->note = $note;
return $this;
}
// public function __toString()
// {
// // dump($this->type->getTitle());
// return $this->type->getTitle();
// }
}

View File

@@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
namespace Chill\AsideActivityBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(schema="chill_asideactivity")
*/
class AsideActivityCategory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\Column(type="json", length=255)
*/
private array $title;
/**
* @ORM\Column(type="boolean")
*/
private bool $isActive = true;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?array
{
return $this->title;
}
public function setTitle(array $title): self
{
$this->title = $title;
return $this;
}
public function getIsActive(): bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Chill\AsideActivityBundle\Form;
use Chill\AsideActivityBundle\Entity\AsideActivityCategory;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
final class AsideActivityCategoryType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('title', TranslatableStringFormType::class,
[
'label' => 'Nom',
])
->add('isActive', ChoiceType::class,
[
'choices' => [
'Yes' => true,
'No' => false
],
'expanded' => true
]);
}
}

View File

@@ -0,0 +1,142 @@
<?php
namespace Chill\AsideActivityBundle\Form;
use Chill\AsideActivityBundle\Entity\AsideActivity;
use Chill\AsideActivityBundle\Entity\AsideActivityCategory;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
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\TextareaType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Security;
final class AsideActivityFormType extends AbstractType
{
protected array $timeChoices;
private TranslatableStringHelper $translatableStringHelper;
private TokenStorageInterface $storage;
public function __construct (TranslatableStringHelper $translatableStringHelper, array $timeChoices, TokenStorageInterface $storage){
$this->timeChoices = $timeChoices;
$this->translatableStringHelper = $translatableStringHelper;
$this->storage = $storage;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$timeChoices = [];
foreach ($this->timeChoices as $e) {
$timeChoices[$e['label']] = $e['seconds'];
}
$durationTimeTransformer = new DateTimeToTimestampTransformer('GMT', 'GMT');
$durationTimeOptions = [
'choices' => $timeChoices,
'placeholder' => 'Choose the duration',
];
$builder
->add('agent', EntityType::class,
[
'label' => 'Agent',
'required' => true,
'class' => User::class,
'data' => $this->storage->getToken()->getUser(),
'attr' => array('class' => 'select2 '),
'placeholder' => 'Choose the agent for whom this activity is created',
'choice_label' => 'username'
])
->add('date', ChillDateType::class,
[
'label' => 'date',
'data' => new \DateTime(),
//SETTING RANGE ONLY POSSIBLE WITH WIDGET 'CHOICE' AND NOT 'SINGLE_TEXT'?
// 'widget' => 'choice',
// 'years' => range(2020, date('Y')),
// 'months' => range(1, date('m')),
// 'days' => range(1, date('d')),
'required' => true
])
->add('type', EntityType::class,
[
'label' => 'Type',
'required' => true,
'class' => AsideActivityCategory::class,
'placeholder' => 'Choose the activity category',
// 'choice_label' => 'title[""]'
'choice_label' => function (AsideActivityCategory $asideActivityCategory) {
return $this->translatableStringHelper->localize($asideActivityCategory->getTitle());
},
])
->add('duration', ChoiceType::class, $durationTimeOptions)
->add('note', ChillTextareaType::class, [
'label' => 'Note',
'required' => false,
]);
foreach (['duration'] as $fieldName)
{
$builder->get($fieldName)
->addModelTransformer($durationTimeTransformer);
$builder->get($fieldName)
->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $formEvent) use (
$timeChoices,
$builder,
$durationTimeTransformer,
$durationTimeOptions,
$fieldName
) {
// set the timezone to GMT, and fix the difference between current and GMT
// the datetimetransformer will then handle timezone as GMT
$timezoneUTC = new \DateTimeZone('GMT');
/* @var $data \DateTimeImmutable */
$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'));
dump($data);
// test if the timestamp is in the choices.
// If not, recreate the field with the new timestamp
if (!in_array($data->getTimestamp(), $timeChoices)) {
// the data are not in the possible values. add them
$timeChoices[$data->format('H:i')] = $data->getTimestamp();
$form = $builder->create($fieldName, ChoiceType::class, array_merge(
$durationTimeOptions, [
'choices' => $timeChoices,
'auto_initialize' => false
]
));
$form->addModelTransformer($durationTimeTransformer);
$formEvent->getForm()->getParent()->add($form->getForm());
}
});
}
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => AsideActivity::class,
]);
}
public function getBlockPrefix(): string
{
return 'chill_asideactivitybundle_asideactivity';
}
}

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace Chill\AsideActivityBundle\Repository;
use Chill\AsideActivityBundle\Entity\AsideActivityCategory;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectRepository;
class AsideActivityCategoryRepository implements ObjectRepository
{
private EntityRepository $repository;
public function __construct(EntityManagerInterface $entityManager)
{
$this->repository = $entityManager->getRepository(AsideActivityCategory::class);
}
public function find($id): ?AsideActivityCategory
{
return $this->repository->find($id);
}
/**
* @return AsideActivityCategory[]
*/
public function findAll(): array
{
return $this->repository->findAll();
}
/**
* @return AsideActivityCategory[]
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria): ?AsideActivityCategory
{
return $this->repository->findOneBy($criteria);
}
public function getClassName(): string
{
return AsideActivityCategory::class;
}
}

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace Chill\AsideActivityBundle\Repository;
use Chill\AsideActivityBundle\Entity\AsideActivity;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectRepository;
final class AsideActivityRepository implements ObjectRepository
{
private EntityRepository $repository;
public function __construct(EntityManagerInterface $entityManager)
{
$this->repository = $entityManager->getRepository(AsideActivity::class);
}
public function find($id): ?AsideActivity
{
return $this->repository->find($id);
}
/**
* @return AsideActivity[]
*/
public function findAll(): array
{
return $this->repository->findAll();
}
/**
* @return AsideActivity[]
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria): ?AsideActivity
{
return $this->repository->findOneBy($criteria);
}
public function getClassName(): string
{
return AsideActivity::class;
}
}

View File

@@ -0,0 +1,37 @@
<div class="{% block crud_content_main_div_class %}col-10 centered{% endblock %}">
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_delete')|trans({ '%as_string%': 'Aside Activity' }) }}</h1>
{% endblock crud_content_header %}
<p class="message-confirm">{{ ('crud.'~crud_name~'.confirm_message_delete')|trans({ '%as_string%': 'Aside Activity' }) }}</p>
{{ form_start(form) }}
<ul class="record_actions">
{% block content_form_actions_back %}
<li class="cancel">
<a class="btn btn-cancel" href="{{ chill_return_path_or('chill_crud_'~crud_name~'_index') }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block content_form_actions_before %}{% endblock %}
{% block content_form_actions_view %}
{% if is_granted(chill_crud_config('role', crud_name, 'view'), entity) %}
<li class="">
<a class="btn btn-show" href="{{ chill_return_path_or('chill_crud_'~crud_name~'_view', { 'id': entity.id }) }}">
{{ 'crud.edit.back_to_view'|trans }}
</a>
</li>
{% endif %}
{% endblock %}
{% block content_form_actions_confirm_delete %}
<li>
<button type="submit" class="btn btn-delete" value="delete-and-close">{{ ('crud.'~crud_name~'.button_delete')|trans }}</button>
</li>
{% endblock content_form_actions_confirm_delete %}
{% block content_form_actions_after %}{% endblock %}
</ul>
{{ form_end(form) }}
</div>

View File

@@ -0,0 +1,8 @@
{% extends '@ChillMain/layout.html.twig' %}
{# {% block title %}{{ ('crud.' ~ crud_name ~ '.delete.title')|trans({'%crud_name%': crud_name}) }}{% endblock %} #}
{% block content %}
{% embed '@ChillAsideActivity/AsideActivity/_delete.html.twig' %}
{% endembed %}
{% endblock content %}

View File

@@ -0,0 +1,13 @@
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{# {% as we are in the admin layout, we override the admin content with the CRUD content %} #}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{# we do not have "view" page. We empty the corresponding block #}
{% block content_form_actions_view %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,8 @@
{% extends '@ChillMain/layout.html.twig' %}
{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %}
{% block content %}
{% embed '@ChillAsideActivity/AsideActivity/_index.html.twig' %}
{% endembed %}
{% endblock content %}

View File

@@ -0,0 +1,107 @@
{% extends "@ChillMain/layout.html.twig" %}
{% block title %}{{ 'Aside activity list' |trans }}{% endblock title %}
{% block content %}
<div class="col-md-10 col-xxl asideactivity-list">
<h2>{{ 'My aside activities' |trans }}</h2>
{% if entities|length == 0 %}
<p class="chill-no-data-statement">
{{ "There aren't any aside activities."|trans }}
<a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create button-small"></a>
</p>
{% else %}
<div class="flex-table my-4 list-records">
{# Sort activities according to date in descending order #}
{% for entity in entities|sort ((a, b) => b.date <=> a.date) %}
{% set t = entity.type %}
{# only load aside activities of current user. #}
{% if entity.agent == app.user %}
<div class="item-bloc">
<div class="item-row main">
<div class="item-col">
<h3>
<b>{{ entity.type.title | localize_translatable_string }}</b>
</h3>
{% if entity.date %}
<p>{{ entity.date|format_date('long') }}</p>
{% endif %}
<div class="duration">
<p>
<i class="fa fa-fw fa-hourglass-end"></i>
{{ entity.duration|date('H:i') }}
</p>
</div>
</div>
<div class="item-col">
<ul class="list-content">
{% if entity.createdBy %}
<li>
<b>{{ 'Created by: '|trans }}{{ entity.createdBy.usernameCanonical }}</b>
</li>
{% endif %}
</ul>
</div>
</div>
{# {%
if entity.note is not empty
or entity.createdBy|length > 0
%}
<div class="item-row details">
{% if entity.note is not empty %}
<div class="item-col comment">
{{ entity.note|chill_markdown_to_html }}
</div>
{% endif %}
</div>
{% endif %} #}
<div class="item-col">
<ul class="list-content">
<ul class="record_actions">
{# <li>
<a href="{{ path('chill_crud_aside_activity_view', { 'id': entity.id} ) }}" class="btn btn-show "></a>
</li> #}
{# TOOD
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
#}
<li>
<a href="{{ path('chill_crud_aside_activity_edit', { 'id': entity.id }) }}" class="btn btn-update "></a>
</li>
{# TOOD
{% endif %}
{% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
#}
<li>
<a href="{{ path('chill_crud_aside_activity_delete', { 'id': entity.id } ) }}" class="btn btn-delete "></a>
</li>
{#
{% endif %}
#}
</ul>
</ul>
</div>
</div>
{% endif %}
{% endfor %}
</div>
<ul class="record_actions">
<li>
<a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create">
{{ 'Add a new aside activity' | trans }}
</a>
</li>
</ul>
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,15 @@
{% extends '@ChillMain/layout.html.twig' %}
{% set activeRouteKey = '' %}
{% block title %}
{% include('@ChillMain/CRUD/_view_title.html.twig') %}
{% endblock %}
{% block content %}
{% embed '@ChillMain/CRUD/_view_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.' ~ crud_name ~ '.title_view')|trans }}</h1>
{% endblock crud_content_header %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,44 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>{{ 'ActivityType list'|trans }}</h1>
<table class="records_list table table-bordered border-dark">
<thead>
<tr>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td>{{ entity.title|localize_translatable_string }}</td>
<td style="text-align:center;">
{%- if entity.isActive -%}
<i class="fa fa-check-square-o"></i>
{%- else -%}
<i class="fa fa-square-o"></i>
{%- endif -%}
</td>
<td>
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('chill_crud_aside_activity_category_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('chill_crud_aside_activity_category_new') }}" class="btn btn-create">
{{ 'Create a new aside activity type'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,3 @@
chill_asideactivities_controllers:
resource: "@ChillAsideActivityBundle/Controller"
type: annotation

View File

@@ -0,0 +1,8 @@
# services:
# chill.asideactivity.form.type.asideactivity:
# class: Chill\AsideActivityBundle\Form\AsideActivityFormType
# arguments:
# - "@chill.main.helper.translatable_string"
# # - "%chill_activity.form.time_duration%"
# tags:
# - { name: form.type, alias: chill_asideactivitybundle_asideactivity }

View File

@@ -0,0 +1,10 @@
---
services:
chill.asideactivity.form.type.asideactivity:
class: Chill\AsideActivityBundle\Form\AsideActivityFormType
arguments:
- "@chill.main.helper.translatable_string"
- "%chill_activity.form.time_duration%"
- "@security.token_storage"
tags:
- { name: form.type, alias: chill_asideactivitybundle_asideactivity }

View File

@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\AsideActivity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210706124644 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE SEQUENCE AsideActivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE AsideActivityType_id_seq INCREMENT BY 1 MINVALUE 1 START 1000');
$this->addSql('CREATE TABLE AsideActivity (id INT NOT NULL, type_id INT NOT NULL, agent_id INT NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, duration TIME(0) WITHOUT TIME ZONE DEFAULT NULL, location VARCHAR(100) DEFAULT NULL, note TEXT DEFAULT NULL, createdBy_id INT NOT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_E9FA2191C54C8C93 ON AsideActivity (type_id)');
$this->addSql('CREATE INDEX IDX_E9FA21913174800F ON AsideActivity (createdBy_id)');
$this->addSql('CREATE INDEX IDX_E9FA219165FF1AEC ON AsideActivity (updatedBy_id)');
$this->addSql('CREATE INDEX IDX_E9FA21913414710B ON AsideActivity (agent_id)');
$this->addSql('COMMENT ON COLUMN AsideActivity.updatedAt IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE TABLE AsideActivityType (id INT NOT NULL, title VARCHAR(255) NOT NULL, isActive BOOLEAN NOT NULL, PRIMARY KEY(id))');
$this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA2191C54C8C93 FOREIGN KEY (type_id) REFERENCES AsideActivityType (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA21913174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA219165FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE AsideActivity ADD CONSTRAINT FK_E9FA21913414710B FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
// this up() migration is auto-generated, please modify it to your needs
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE AsideActivity DROP CONSTRAINT FK_E9FA2191C54C8C93');
$this->addSql('DROP SEQUENCE AsideActivity_id_seq CASCADE');
$this->addSql('DROP SEQUENCE AsideActivityType_id_seq CASCADE');
$this->addSql('DROP TABLE AsideActivity');
$this->addSql('DROP TABLE AsideActivityType');
}
}

View File

@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\AsideActivity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210804082249 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA chill_asideactivity');
$this->addSql('ALTER TABLE asideactivity DROP CONSTRAINT fk_e9fa2191c54c8c93');
$this->addSql('DROP SEQUENCE asideactivity_id_seq CASCADE');
$this->addSql('DROP SEQUENCE asideactivitytype_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE chill_asideactivity.AsideActivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE chill_asideactivity.AsideActivityCategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE chill_asideactivity.AsideActivity (id INT NOT NULL, type_id INT NOT NULL, agent_id INT NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, duration INT DEFAULT NULL, location VARCHAR(100) DEFAULT NULL, note TEXT DEFAULT NULL, createdBy_id INT NOT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_A866DA0EC54C8C93 ON chill_asideactivity.AsideActivity (type_id)');
$this->addSql('CREATE INDEX IDX_A866DA0E3174800F ON chill_asideactivity.AsideActivity (createdBy_id)');
$this->addSql('CREATE INDEX IDX_A866DA0E65FF1AEC ON chill_asideactivity.AsideActivity (updatedBy_id)');
$this->addSql('CREATE INDEX IDX_A866DA0E3414710B ON chill_asideactivity.AsideActivity (agent_id)');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.createdAt IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.updatedAt IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.date IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE TABLE chill_asideactivity.AsideActivityCategory (id INT NOT NULL, title JSON NOT NULL, isActive BOOLEAN NOT NULL, PRIMARY KEY(id))');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0EC54C8C93 FOREIGN KEY (type_id) REFERENCES chill_asideactivity.AsideActivityCategory (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0E3174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0E65FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD CONSTRAINT FK_A866DA0E3414710B FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('DROP TABLE asideactivitytype');
$this->addSql('DROP TABLE asideactivity');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP CONSTRAINT FK_A866DA0EC54C8C93');
$this->addSql('DROP SEQUENCE chill_asideactivity.AsideActivity_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_asideactivity.AsideActivityCategory_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE asideactivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE asideactivitytype_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE asideactivitytype (id INT NOT NULL, title VARCHAR(255) NOT NULL, isactive BOOLEAN NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE asideactivity (id INT NOT NULL, type_id INT NOT NULL, agent_id INT NOT NULL, createdby_id INT NOT NULL, updatedby_id INT DEFAULT NULL, createdat TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedat TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, duration TIME(0) WITHOUT TIME ZONE DEFAULT NULL, location VARCHAR(100) DEFAULT NULL, note TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX idx_e9fa21913174800f ON asideactivity (createdby_id)');
$this->addSql('CREATE INDEX idx_e9fa2191c54c8c93 ON asideactivity (type_id)');
$this->addSql('CREATE INDEX idx_e9fa219165ff1aec ON asideactivity (updatedby_id)');
$this->addSql('CREATE INDEX idx_e9fa21913414710b ON asideactivity (agent_id)');
$this->addSql('COMMENT ON COLUMN asideactivity.updatedat IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE TABLE chill_main_address_legacy (id INT DEFAULT NULL, postcode_id INT DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, streetnumber VARCHAR(255) DEFAULT NULL, validfrom DATE DEFAULT NULL, isnoaddress BOOLEAN DEFAULT NULL, customs JSONB DEFAULT NULL, floor VARCHAR(16) DEFAULT NULL, corridor VARCHAR(16) DEFAULT NULL, steps VARCHAR(16) DEFAULT NULL, buildingname VARCHAR(255) DEFAULT NULL, flat VARCHAR(16) DEFAULT NULL, distribution VARCHAR(255) DEFAULT NULL, extra VARCHAR(255) DEFAULT NULL, validto DATE DEFAULT NULL, point VARCHAR(255) DEFAULT NULL, linkedtothirdparty_id INT DEFAULT NULL)');
$this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa2191c54c8c93 FOREIGN KEY (type_id) REFERENCES asideactivitytype (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa21913174800f FOREIGN KEY (createdby_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa219165ff1aec FOREIGN KEY (updatedby_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE asideactivity ADD CONSTRAINT fk_e9fa21913414710b FOREIGN KEY (agent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('DROP TABLE chill_asideactivity.AsideActivity');
$this->addSql('DROP TABLE chill_asideactivity.AsideActivityCategory');
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\AsideActivity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210806140343 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity DROP duration');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD duration INT DEFAULT NULL');
}
}

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\AsideActivity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210806140710 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ADD duration TIME(0) WITHOUT TIME ZONE DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP duration');
}
}

View File

@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\AsideActivity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210810084456 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER createdat TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER createdat DROP DEFAULT');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER updatedat TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER updatedat DROP DEFAULT');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER date TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ALTER date DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.asideactivity.createdAt IS NULL');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.asideactivity.updatedAt IS NULL');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.asideactivity.date IS NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER createdAt TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER createdAt DROP DEFAULT');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER updatedAt TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER updatedAt DROP DEFAULT');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER date TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ALTER date DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.createdat IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.updatedat IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.date IS \'(DC2Type:datetime_immutable)\'');
}
}

View File

@@ -0,0 +1,82 @@
#general
Show the aside activity: Voir l'activité annexe
Edit the aside activity: Modifier l'activité annexe
Aside activity: Activité annexe
Duration time: Durée
durationTime: durée
user_username: nom de l'utilisateur
Remark: Commentaire
No comments: Aucun commentaire
Add a new aside activity: Ajouter une nouvelle activité annexe
Aside activity list: Activités annexes
present: présent
not present: absent
Delete: Supprimer
Update: Mettre à jour
Update activity: Modifier l'activité
Aside activity data: Données de l'activité annexe
No reason associated: Aucun sujet
There aren't any aside activities.: Aucune activité annexe enregistrée.
type_name: type de l'activité
Type: Type
Invisible: Invisible
Optional: Optionnel
Required: Obligatoire
Persons: Personnes
Users: Utilisateurs
Emergency: Urgent
by: 'Par '
location: Lieu
# Crud
crud:
aside_activity:
title_view: Détail de l'activité annexe
title_new: Nouvelle activité annexe
title_edit: Edition d'une activité annexe
title_delete: Supprimation d'une activité annexe
button_delete: Supprimer
confirm_message_delete: Êtes-vous sûr de vouloir supprimer cet activité annexe?
aside_activity_category:
title_new: Nouvelle catégorie d'activité annexe
title_edit: Edition d'une catégorie de type d'activité
#forms
Activity creation: Nouvelle activité annexe
Create a new aside activity type: Nouvelle categorie d'activité annexe
Create: Créer
Back to the list: Retour à la liste
Save activity: Sauver l'activité
Reset form: Remise à zéro du formulaire
Choose the agent for whom this activity is created: Choissisez l'utilisateur pour qui l'activité est creéé.
Choose the activity category: Choissisez le type d'activité
Choose the duration: Choisir la durée
Choose a category: Choisir un categorie
Is active: Actif
Agent: Utilisateur
date: Date
Duration: Durée
Note: Note
5 minutes: 5 minutes
10 minutes: 10 minutes
15 minutes: 15 minutes
20 minutes: 20 minutes
25 minutes: 25 minutes
30 minutes: 30 minutes
45 minutes: 45 minutes
1 hour: 1 heure
1 hour 15: 1 heure 15
1 hour 30: 1 heure 30
1 hour 45: 1 heure 45
2 hours: 2 heures
#list
My aside activities: Mes activités annexes
Date: Date
Created by: Creér par
#Aside activity delete
Delete aside activity: Supprimer une activité annexe
Are you sure you want to remove the aside activity concerning "%name%" ?: Êtes-vous sûr de vouloir supprimer une activité annexe qui concerne "%name%" ?
The activity has been successfully removed.: L'activité a été supprimée.

View File

@@ -0,0 +1,11 @@
composer.lock
vendor/*
parameters.yml
*~
*.DS_Store
*.sass-cache
Resources/node_modules/
Tests/Fixtures/App/app/config/parameters.yml
/nbproject/private/
Resources/test/Fixtures/App/bootstrap.php.cache

View File

@@ -0,0 +1,9 @@
<?php
namespace Chill\DocGeneratorBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillDocGeneratorBundle extends Bundle
{
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Chill\DocGeneratorBundle\Context;
/**
* Interface for context for for document generation
*/
interface DocGeneratorContextInterface
{
/**
* has form
*/
public function hasForm(): bool;
/**
* Generate the form that display
*/
public function getForm($entity);
/**
* True of false which entity supports
*/
public function supports(string $entityClass): bool;
/**
* Get the data that will be injected to the generated document
*/
public function getData($entity): array;
}

View File

@@ -0,0 +1,57 @@
<?php
namespace Chill\DocGeneratorBundle\Context;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
/**
* Context that display a form to select a member of a houseHold
*/
class HouseholdMemberSelectionContext implements DocGeneratorContextInterface
{
/**
* has form
*/
public function hasForm(): bool {
return true;
}
/**
* Generate the form that display
*/
public function getForm($entity) {
// TODO Get FormFactory and create a form
// access to the house hold for the AccompanyingPeriod pr the SocialAction
// and configure the form to select member of the family
}
/**
* True of false which entity supports
*/
public function supports(string $entityClass): bool {
return
($entityClass == AccompanyingPeriod::class) ||
($entityClass == SocialAction::class);
}
/**
* Get the data that will be injected to the generated document
*/
public function getData($entity): array {
$ret = [];
if(get_class($entity) == AccompanyingPeriod::class) {
// TODO mettre ça dans un service
$ret = ['AccompanyingPeriod' => $entity];
} elseif(get_class($entity) == SocialAction::class) {
$ret = ['SocialAction' => $entity];
}
// TODO AJOUTER LES DONNES DU FORMULAIRE
return $ret;
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace Chill\DocGeneratorBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
class AdminDocGeneratorTemplateController extends CRUDController
{
}

View File

@@ -0,0 +1,76 @@
<?php
namespace Chill\DocGeneratorBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\Routing\Annotation\Route;
use ChampsLibres\AsyncUploaderBundle\TempUrl\TempUrlOpenstackGenerator;
use PhpOffice\PhpWord\TemplateProcessor;
/**
* Class DocGeneratorController
*
* @package Chill\DocGenerator\Controller
*/
class DocGeneratorController extends AbstractController
{
/**
* @Route(
* "{_locale}/doc/gen/test",
* name="chill_docgenerator_test"
* )
*
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function testAction()
{
return (new Response())
->setContent('Test');
}
/**
* @Route(
* "{_locale}/doc/gen/test",
* name="chill_docgenerator_test"
* )
*
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function getDoc(Request $request, TempUrlOpenstackGenerator $tempUrlGenerator)
{
$p = $tempUrlGenerator->generate(
'GET',
'FORMULAIRE_AEB.docx',
$request->query->has('expires_delay') ? $request->query->getInt('expires_delay', 0) : null
);
$tmpfname = tempnam(sys_get_temp_dir(), 'DOC_TEMPLATE');
file_put_contents($tmpfname, file_get_contents($p->{"url"}));
$templateProcessor = new TemplateProcessor($tmpfname);
$templateProcessor->setValues(array('firstname' => 'John', 'lastname' => 'Doe'));
$tmpfname2 = tempnam(sys_get_temp_dir(), 'DOC_GENERATED');
$templateProcessor->saveAs($tmpfname2);
unlink($tmpfname);
$fileContent = fopen($tmpfname2, 'r'); // the generated file content
$response = new Response(fread($fileContent, filesize($tmpfname2)));
$disposition = HeaderUtils::makeDisposition(
HeaderUtils::DISPOSITION_ATTACHMENT,
'foo.docx'
);
$response->headers->set('Content-Disposition', $disposition);
unlink($tmpfname2);
return $response;
}
}

View File

@@ -0,0 +1,55 @@
<?php
namespace Chill\DocGeneratorBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
/**
* Load DocGeneratorTemplate
*
* @author Champs-Libres Coop
*/
class LoadDocGeneratorTemplate extends AbstractFixture
{
public function load(ObjectManager $manager)
{
$templates = [
[
'name' => ['fr' => 'FORMULAIRE AEB'],
'desc' => 'stocké sur openstack comedienbe',
'file' => 'FORMULAIRE_AEB.docx',
'context' => 'Chill\DocGeneratorBundle\Context\HouseholdMemberSelectionContext',
'entities' => ['Chill\PersonBundle\Entity\AccompanyingPeriod', 'Chill\PersonBundle\Entity\SocialWork\SocialAction'],
], [
'name' => ['fr' => 'AIDE ALIMENTAIRE'],
'desc' => 'stocké sur openstack comedienbe',
'file' => 'AIDE_ALIMENTAIRE.docx',
'context' => 'Chill\DocGeneratorBundle\Context\HouseholdMemberSelectionContext',
'entities' => ['Chill\PersonBundle\Entity\AccompanyingPeriod', 'Chill\PersonBundle\Entity\SocialWork\SocialAction'],
],
];
foreach ($templates as $template) {
print('Adding doc generator templates '.$template['file'].")\n");
$newTemplate = (new DocGeneratorTemplate())
->setName($template['name'])
->setDescription($template['desc'])
->setFile($template['file'])
->setContext($template['context'])
->setEntities($template['entities'])
;
$manager->persist($newTemplate);
$manager->flush();
}
}
}

View File

@@ -0,0 +1,81 @@
<?php
namespace Chill\DocGeneratorBundle\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;
/**
* This is the class that loads and manages your bundle configuration.
*
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
*/
class ChillDocGeneratorExtension extends Extension implements PrependExtensionInterface
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$loader->load('services/controller.yml');
$loader->load('services/fixtures.yml');
$loader->load('services/form.yml');
}
public function prepend(ContainerBuilder $container)
{
$this->preprendRoutes($container);
$this->prependCruds($container);
}
protected function preprendRoutes(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', array(
'routing' => array(
'resources' => array(
'@ChillDocGeneratorBundle/Resources/config/routes.yml'
)
)
));
}
/**
* @param ContainerBuilder $container
*/
protected function prependCruds(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate::class,
'name' => 'docgen_template',
'base_path' => '/admin/docgen/template',
'form_class' => \Chill\DocGeneratorBundle\Form\DocGeneratorTemplateType::class,
'controller' => \Chill\DocGeneratorBundle\Controller\AdminDocGeneratorTemplateController::class,
'actions' => [
'index' => [
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/index.html.twig',
'role' => 'ROLE_ADMIN'
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/edit.html.twig',
]
]
]
]
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Chill\DocGeneratorBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* 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/configuration.html}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('chill_calendar');
$rootNode = $treeBuilder->getRootNode('chill_calendar');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}

View File

@@ -0,0 +1,123 @@
<?php
namespace Chill\DocGeneratorBundle\Entity;
use Chill\DocGeneratorBundle\Repository\DocGeneratorTemplateRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=DocGeneratorTemplateRepository::class)
* @ORM\Table(name="chill_docgen_template")
*/
class DocGeneratorTemplate
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private int $id;
/**
* @ORM\Column(type="json_array")
*/
private array $name = [];
/**
* @ORM\Column(type="text", nullable=true)
*/
private string $description;
/**
* @ORM\Column(type="simple_array")
*
* Class name of the entities for which this template can be used
*
* so if $entities = ['Chill\PersonBundle\Entity\AccompanyingPeriod', 'Chill\PersonBundle\Entity\SocialWork\SocialAction']
* this template can be selected for an AccompanyingPeriod or a SocialAction
*/
private array $entities = [];
/**
* @ORM\Column(type="string", length=255)
*
* Class name of the context to use
*
* so if $context = ''
* this template will use '' as context
*/
private string $context;
/**
* @ORM\Column(type="string", length=255)
*/
private string $file;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?array
{
return $this->name;
}
public function setName(array $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getFile(): ?string
{
return $this->file;
}
public function setFile(string $file): self
{
$this->file = $file;
return $this;
}
public function getEntities(): ?array
{
return $this->entities;
}
public function setEntities(array $entities): self
{
$this->entities = $entities;
return $this;
}
public function getContext(): ?string
{
return $this->context;
}
public function setContext(string $context): self
{
$this->context = $context;
return $this;
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace Chill\DocGeneratorBundle\Form;
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class DocGeneratorTemplateType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TranslatableStringFormType::class, [
'label' => 'Nom'
])
->add('description')
->add('file')
;
}
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', DocGeneratorTemplate::class)
;
}
}

View File

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

View File

@@ -0,0 +1,5 @@
Doc generator bundle
====================
This bundle generates documents (from templates)

View File

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

View File

@@ -0,0 +1,3 @@
chill_docgen_controllers:
resource: '../../Controller/'
type: annotation

View File

@@ -0,0 +1,8 @@
---
services:
Chill\DocGeneratorBundle\Repository\:
autowire: true
resource: '../../Repository/'
tags:
- { name: 'doctrine.repository_service' }

View File

@@ -0,0 +1,5 @@
services:
Chill\DocGeneratorBundle\Controller\:
autowire: true
resource: '../../../Controller'
tags: ['controller.service_arguments']

View File

@@ -0,0 +1,6 @@
---
services:
Chill\DocGeneratorBundle\DataFixtures\ORM\:
autowire: true
resource: ../../DataFixtures/ORM
tags: [ 'doctrine.fixture.orm' ]

View File

@@ -0,0 +1,2 @@
---
services:

View File

@@ -0,0 +1,12 @@
{% extends '@ChillPerson/Admin/layout.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,19 @@
{% extends '@ChillPerson/Admin/layout.html.twig' %}
{% block layout_wvm_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>{{ 'Title'|trans }}</th>
<th>{{ 'File'|trans }}</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.name | localize_translatable_string }}</td>
<td>{{ entity.file }}</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillPerson/Admin/layout.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,6 @@
// this file loads all assets from the Chill DocGenerator bundle
module.exports = function(encore, entries) {
encore.addAliases({
ChillDocGeneratorAssets: __dirname + '/Resources/public'
});
};

View File

@@ -0,0 +1,30 @@
{
"name": "chill-project/docgen",
"description": "This bundle extends chill for generation of documents",
"type": "symfony-bundle",
"license": "AGPL-3.0-or-later",
"keywords" : ["chill", "social work"],
"homepage" : "hhttps://gitlab.com/Chill-Projet/chill-bundles/",
"autoload": {
"psr-4": { "Chill\\DocGeneratorBundle\\": "" }
},
"autoload-dev": {
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
},
"authors": [
{
"name": "Champs-Libres",
"email": "info@champs-libres.coop"
}
],
"require": {
},
"require-dev": {
},
"extra": {
"app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations",
"symfony-app-dir": "Test/Fixtures/App/app/"
},
"minimum-stability": "dev",
"prefer-stable": true
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\DocGenerator;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Creation of table for storing DocGenTemplate
*/
final class Version20210805162522 extends AbstractMigration
{
public function getDescription(): string
{
return 'Creation of table for storing DocGenTemplate';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE SEQUENCE chill_docgen_template_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE chill_docgen_template (id INT NOT NULL, name JSON NOT NULL, description TEXT DEFAULT NULL, file VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
}
public function down(Schema $schema): void
{
$this->addSql('DROP SEQUENCE chill_docgen_template_id_seq CASCADE');
$this->addSql('DROP TABLE chill_docgen_template');
}
}

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\DocGenerator;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Add entities and context fields to DocGenTemplate
*/
final class Version20210812214310 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add entities and context fields to DocGenTemplate';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_docgen_template ADD entities TEXT');
$this->addSql('ALTER TABLE chill_docgen_template ADD context VARCHAR(255)');
$this->addSql('COMMENT ON COLUMN chill_docgen_template.entities IS \'(DC2Type:simple_array)\'');
$this->addSql('COMMENT ON COLUMN chill_docgen_template.name IS \'(DC2Type:json_array)\'');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_docgen_template DROP entities');
$this->addSql('ALTER TABLE chill_docgen_template DROP context');
$this->addSql('COMMENT ON COLUMN chill_docgen_template.name IS NULL');
}
}

View File

@@ -22,11 +22,11 @@
{% block title %}{{ 'Editing document for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %} {% block title %}{{ 'Editing document for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %}
{% block personcontent %} {% block personcontent %}
<h1>{{ 'Edit Document' | trans }}</h1> <h1>{{ 'Edit Document' | trans }}</h1>
{{ form_errors(form) }} {{ form_errors(form) }}
{{ form_start(form) }} {{ form_start(form) }}
{{ form_row(form.title) }} {{ form_row(form.title) }}
{{ form_row(form.date) }} {{ form_row(form.date) }}
{{ form_row(form.category) }} {{ form_row(form.category) }}
@@ -49,16 +49,16 @@
</li> </li>
{% endif %} #} {% endif %} #}
</ul> </ul>
{{ form_end(form) }} {{ form_end(form) }}
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script src="{{ asset('build/async_upload.js') }}" type="text/javascript"></script> {{ encore_entry_script_tags('mod_async_upload') }}
{% endblock %} {% endblock %}
{% block css %} {% block css %}
<link rel="stylesheet" href="{{ asset('build/async_upload.css') }}"/> {{ encore_entry_link_tags('mod_async_upload') }}
{% endblock %} {% endblock %}

View File

@@ -24,7 +24,7 @@
{% block title %}{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %} {% block title %}{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %}
{% block js %} {% block js %}
<script src="{{ asset('build/async_upload.js') }}" type="text/javascript"></script> {{ encore_entry_script_tags('mod_async_upload') }}
{% endblock %} {% endblock %}
{% block personcontent %} {% block personcontent %}

View File

@@ -22,11 +22,11 @@
{% block personcontent %} {% block personcontent %}
<h1>{{ 'New document for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}</h1> <h1>{{ 'New document for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}</h1>
{{ form_errors(form) }} {{ form_errors(form) }}
{{ form_start(form) }} {{ form_start(form) }}
{{ form_row(form.title) }} {{ form_row(form.title) }}
{{ form_row(form.date) }} {{ form_row(form.date) }}
{{ form_row(form.category) }} {{ form_row(form.category) }}
@@ -48,9 +48,9 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script src="{{ asset('build/async_upload.js') }}" type="text/javascript"></script> {{ encore_entry_script_tags('mod_async_upload') }}
{% endblock %} {% endblock %}
{% block css %} {% block css %}
<link rel="stylesheet" href="{{ asset('build/async_upload.css') }}"/> {{ encore_entry_link_tags('mod_async_upload') }}
{% endblock %} {% endblock %}

View File

@@ -23,19 +23,19 @@
{% block title %}{{ 'Detail of document of %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %} {% block title %}{{ 'Detail of document of %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %}
{% block js %} {% block js %}
<script src="{{ asset('build/async_upload.js') }}" type="text/javascript"></script> {{ encore_entry_script_tags('mod_async_upload') }}
{% endblock %} {% endblock %}
{% block personcontent %} {% block personcontent %}
<h1>{{ 'Document %title%' | trans({ '%title%': document.title }) }}</h1> <h1>{{ 'Document %title%' | trans({ '%title%': document.title }) }}</h1>
<dl class="chill_view_data"> <dl class="chill_view_data">
<dt>{{ 'Title'|trans }}</dt> <dt>{{ 'Title'|trans }}</dt>
<dd>{{ document.title }}</dd> <dd>{{ document.title }}</dd>
<dt>{{ 'Scope' | trans }}</dt> <dt>{{ 'Scope' | trans }}</dt>
<dd>{{ document.scope.name | localize_translatable_string }}</dd> <dd>{{ document.scope.name | localize_translatable_string }}</dd>
<dt>{{ 'Category'|trans }}</dt> <dt>{{ 'Category'|trans }}</dt>
<dd>{{ document.category.name|localize_translatable_string }}</dd> <dd>{{ document.category.name|localize_translatable_string }}</dd>
@@ -58,7 +58,7 @@
{{ 'Back to the list' | trans }} {{ 'Back to the list' | trans }}
</a> </a>
</li> </li>
<li> <li>
{{ m.download_button(document.object, document.title) }} {{ m.download_button(document.object, document.title) }}
</li> </li>

View File

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

View File

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

View File

@@ -1 +0,0 @@
require('./css/chillevent.css');

View File

@@ -108,8 +108,6 @@
{{ chill_pagination(paginator) }} {{ chill_pagination(paginator) }}
{% endif %} {% endif %}
{% form_theme form_add_event_participation_by_person 'bootstrap_4_layout.html.twig' %}
<div class="input-group mb-3"> <div class="input-group mb-3">
{{ form_start(form_add_event_participation_by_person) }} {{ form_start(form_add_event_participation_by_person) }}
{# {#
@@ -137,4 +135,4 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -3,9 +3,7 @@
{% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %} {% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %}
{% block title 'Participation creation'|trans %} {% block title 'Participation creation'|trans %}
{% form_theme form _self %}
{% block _collection_row %} {% block _collection_row %}
<tr> <tr>
<td> <td>
@@ -28,10 +26,10 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
{% include 'ChillEventBundle:Participation:_ignored_participations.html.twig' with ignored_participations %} {% include 'ChillEventBundle:Participation:_ignored_participations.html.twig' with ignored_participations %}
{{ form_start(form) }} {{ form_start(form) }}
<table> <table>
<thead> <thead>
<tr> <tr>
@@ -47,10 +45,10 @@
<td>{{ form_widget(participationField.role) }}</td> <td>{{ form_widget(participationField.role) }}</td>
<td>{{ form_widget(participationField.status) }}</td> <td>{{ form_widget(participationField.status) }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions">
<li class="cancel"> <li class="cancel">
<a href="{{ path('chill_event__event_show', { 'event_id' : participations[0].event.id } ) }}" class="btn btn-cancel"> <a href="{{ path('chill_event__event_show', { 'event_id' : participations[0].event.id } ) }}" class="btn btn-cancel">
@@ -61,7 +59,7 @@
{{ form_widget(form.submit, { 'attr' : { 'class' : 'btn btn-create' } } ) }} {{ form_widget(form.submit, { 'attr' : { 'class' : 'btn btn-create' } } ) }}
</li> </li>
</ul> </ul>
{{ form_end(form) }} {{ form_end(form) }}
{% endblock %} {% endblock %}

View File

@@ -1,4 +1,4 @@
// this file loads all assets from the Chill Event Bundle module.exports = function(encore, entries)
module.exports = function(encore, entries) { {
entries.push(__dirname + '/Resources/public/index.js'); entries.push(__dirname + '/Resources/public/chill/index.js');
}; };

View File

@@ -1137,6 +1137,7 @@ class CRUDController extends AbstractController
} }
/** /**
* @todo (check how to do this with dependency injection and make changes...)
* @return PaginatorFactory * @return PaginatorFactory
*/ */
protected function getPaginatorFactory(): PaginatorFactory protected function getPaginatorFactory(): PaginatorFactory

View File

@@ -0,0 +1,59 @@
<?php
namespace Chill\MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\MainBundle\Repository\NotificationRepository;
use Chill\MainBundle\Notification\NotificationRenderer;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Routing\Annotation\Route;
use Chill\MainBundle\Pagination\PaginatorFactory;
/**
* @Route("/{_locale}/notification")
*/
class NotificationController extends AbstractController
{
private $security;
public function __construct(Security $security)
{
$this->security = $security;
}
/**
* @Route("/show", name="chill_main_notification_show")
*/
public function showAction(
NotificationRepository $notificationRepository, NotificationRenderer $notificationRenderer,
PaginatorFactory $paginatorFactory)
{
$currentUser = $this->security->getUser();
$notificationsNbr = $notificationRepository->countAllForAttendee(($currentUser));
$paginator = $paginatorFactory->create($notificationsNbr);
$notifications = $notificationRepository->findAllForAttendee(
$currentUser,
$limit=$paginator->getItemsPerPage(),
$offset= $paginator->getCurrentPage()->getFirstItemNumber());
$templateData = array();
foreach ($notifications as $notification) {
$data = [
'template' => $notificationRenderer->getTemplate($notification),
'template_data' => $notificationRenderer->getTemplateData($notification),
'notification' => $notification
];
$templateData[] = $data;
}
return $this->render('@ChillMain/Notification/show.html.twig', [
'datas' => $templateData,
'notifications' => $notifications,
'paginator' => $paginator,
]);
}
}

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