Compare commits

..

419 Commits

Author SHA1 Message Date
d8f1f4cbdd Added links to admin menu for managing taxonomies 2022-04-21 08:46:13 +01:00
22640f02b6 Started adding HookHelper and tests but the tests aren't working 2022-04-21 08:29:32 +01:00
797da77803 mob next [ci-skip] [ci skip] [skip ci] 2022-04-08 12:51:38 +01:00
66f95f46bf mob next [ci-skip] [ci skip] [skip ci]
lastFile:src/Plugin/Derivative/SeeAllOrganisationsMenuLink.php
2022-04-08 13:20:01 +02:00
b85cbaf398 Added actor type links to see-all menu 2022-04-08 12:02:53 +01:00
34b7a1c7c9 fixed redirect after deleting activity - defaults to target if there's no case 2022-04-03 19:27:43 +01:00
fb2249d9bd fixed event attendees widget 2022-04-03 19:12:03 +01:00
614293c114 Added case provider role to opencase config 2022-04-03 17:52:12 +01:00
167166b898 Added target field to case, and added fee category vocab to opencase config 2022-04-03 17:31:00 +01:00
c3f802835f Made everything have revisions all the time 2022-04-03 17:01:19 +01:00
13ddf5aa13 fixed deprecated functions 2022-04-03 14:51:38 +01:00
225e92a51c Added target field to activity 2022-04-03 14:37:40 +01:00
60c64afcab removed config from opencase_defaults 2022-04-03 14:19:05 +01:00
49ab81ca23 fixed deprecated functions that were breaking revisions. 2022-04-03 13:39:01 +01:00
65fe65474e replaced deprecated function 2022-03-17 10:41:39 +00:00
57fae7c1c3 Removed full name field, thus fixing name-not-changing bug 2022-03-17 10:52:40 +01:00
cc551b0851 Added Provider field to cases, auto-completed from actor linked to logged-in user. DB update required 2022-01-21 15:00:26 +00:00
40435a16be Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase 2022-01-20 15:59:39 +00:00
f783fa2373 removed commented-out code 2022-01-20 15:59:23 +00:00
8b725e5a9a removed commented-out code 2022-01-20 15:42:37 +00:00
7c3b007ff9 Authenticated user can see cases they are a provider for. 2022-01-20 14:48:53 +00:00
f39f4a331d changed activity access controller to allow users to view and edit ones they own 2022-01-20 10:52:28 +00:00
6069ac0901 changed CaseInvolvement to reference case provisions 2022-01-20 10:52:04 +00:00
240a55f54f Activities get deleted when case deleted. 2021-12-30 13:43:19 +00:00
b194367eef changed label of published checkbox to "Visible" 2021-12-10 09:45:22 +00:00
f293676fa5 Added css for paragraphs 2021-12-10 09:35:42 +00:00
ba4e6668aa css and removing the "left" and "right" classes from templates 2021-12-05 19:16:39 +00:00
3b62ebd0ee removed default reporting module as it is broken. 2021-12-05 18:36:39 +00:00
198a3f0558 corrected url for contact details history link 2021-12-05 17:36:11 +00:00
833c21346d changed label of activity_date_time to "Date" 2021-12-05 16:27:07 +00:00
4b84c99541 fixed return type of client_id callback when creating a case 2021-12-04 16:58:18 +00:00
0de22b7e90 removed uuids from configs, and removed some depcreated code from update hook 2021-12-04 14:42:40 +00:00
dad1ffc746 removed name field from client form 2021-12-04 11:29:57 +00:00
f6c7519a11 added case fee and case provision permissions to opencase admin role 2021-12-04 11:24:44 +00:00
27e7e3ae2a removed stuff to do with allowed activity types. 2021-12-04 11:19:57 +00:00
5eef57f470 opencase_defaults config is in good order. 2021-12-04 11:14:53 +00:00
d0fea802ee changed namespace of case stuff from opencase_entities to opencase_cases 2021-12-04 10:11:02 +00:00
260979edcc Fixed bugs to do with entity type relations widget 2021-12-04 09:08:11 +00:00
dbc38e8f61 Added config_export stanzas to entity types 2021-12-04 07:26:17 +00:00
c95f8280bc removed contextual menu block 2021-12-04 06:54:45 +00:00
24a8e8864f Commented out actor types per case in entity relations widget 2021-12-04 06:47:38 +00:00
90c4462512 removed basefieldoverride configs for actors_involved as field no longer exists 2021-12-04 06:45:51 +00:00
52f77cb342 Added config directory to opencase_defaults 2021-12-04 06:43:37 +00:00
5f790c73c7 Removed obsolete code from opencase_defaults 2021-12-04 06:30:43 +00:00
f617fc207e versioning 2021-12-03 16:45:27 +00:00
0c9707419e final css tweaks 2021-11-29 20:24:37 +01:00
042e5853bb Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase into trav 2021-11-29 20:13:19 +01:00
720b6f005d removed duplicate permissions_callback key 2021-11-29 18:18:15 +00:00
cc2f03ddb3 versioning 2021-11-27 17:27:19 +00:00
2411813bd6 Added revision metadata keys for Drupal 9 2021-11-27 16:19:06 +00:00
d4e8991804 replaced deprecated functions 2021-11-27 15:19:16 +00:00
658e60f296 Merge branch 'master' into trav 2021-11-27 15:56:22 +01:00
2ecef5c1dd Merge branch 'trav' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase into trav 2021-11-27 15:56:09 +01:00
92e81ee518 css 2021-11-27 15:45:42 +01:00
d7197d7ed6 Follow-ups due 2021-11-27 15:45:42 +01:00
3458949bb0 extended name field on cases 2021-11-27 11:25:41 +00:00
9e18b3ea28 Added reporting menu 2021-11-17 07:55:22 +00:00
623e801c58 Made case provider field use view to filter out inactive and unpubllished 2021-11-16 08:06:06 +00:00
f9d4820ac2 made activity date and time field configurable 2021-11-16 07:05:07 +00:00
88cd511d9f Made amount field required on case fee 2021-11-15 18:08:49 +00:00
9ee00ed738 changed paths from /admin/opencase to /opencase for new entities, in line with existing ones 2021-11-15 13:51:03 +00:00
ff94eb8285 Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase 2021-11-12 10:06:32 +00:00
cf7892ed15 Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase 2021-11-12 10:06:11 +00:00
72e7cb99c3 Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase 2021-11-12 09:12:36 +00:00
04d6525d6c version 8.0-3.0 - update required
Added amount field to case fee, total fee to case, and code to calculate the total
2021-11-12 09:12:01 +00:00
d9453c1323 Added amount field to case fee, total fee to case, and code to calculate the total 2021-11-12 09:11:00 +00:00
3eba291d5a made field display configurable 2021-11-12 06:36:52 +00:00
de691b5a52 Added notes field to cases 2021-11-11 15:27:25 +00:00
8cde0b8892 made published field configurable on case fee 2021-11-11 14:35:45 +00:00
cffe817ce9 Added Case Fee entity 2021-11-11 14:07:13 +00:00
3753b4e25c removed working-out code 2021-11-11 08:42:15 +00:00
f601890ad0 Added Case Provision entity for recording caseworker involvement with cases 2021-11-11 08:39:18 +00:00
6dca2e98e9 Fixed duplicate key in permissions.yml which Drupal 9 disallows 2021-11-06 12:25:06 +00:00
c19b7d4be8 upgraded to drupal 9 2021-10-23 18:18:41 +01:00
b6afcfe47a OC Admin menu is now shown if you have permission to administer either bundles or users 2021-10-15 15:31:24 +01:00
4b8872b586 Increased character limit of email address fields 2021-10-06 10:39:37 +01:00
8d2d095b8e When a user who can't see unpublished entities unpublishes one, it redirects to the home page and displays a message. 2021-09-17 15:36:48 +01:00
0c977a7d48 Merge branch 'master' into trav 2021-09-17 15:37:11 +02:00
a4c02ed249 colour of accrediation count figures 2021-09-17 14:32:01 +01:00
a0e4b4028f Merge branch 'master' into trav 2021-09-17 15:27:04 +02:00
5c20e83ed5 Follow-ups due 2021-09-17 15:22:56 +02:00
78b8371be9 CSS for Accreditation Count form, and some other changes 2021-09-17 14:21:56 +01:00
48e6ae4196 Changed description of Published field 2021-09-13 14:34:29 +01:00
ac4e6eddd5 Made published field configurable on forms, and made views respect permissions 2021-09-13 14:15:53 +01:00
b1a8534d29 Removed debugging code and changed default name of organisation relation 2021-09-03 11:11:02 +02:00
42bf2c8e77 Removed ActorCaseRelation stuff- can't get it to work, will try again if it's asked for 2021-08-27 08:38:04 +01:00
7e4acae864 Revert "Added actor-case relation"
This reverts commit c7d36df842.
2021-08-27 08:37:16 +01:00
80f86c62fd Merge branch 'demo' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase into demo 2021-08-26 21:42:27 +01:00
794bc0da68 Pulling case_id through when creating an activity and client_id when creating a case. (Only for demo really; bit of tech debt) 2021-08-26 21:41:36 +01:00
892a7ae35b Commented out case access stuff; need to re-add that using relation entities 2021-08-26 19:10:05 +01:00
3586ef5788 Fixed theme function issue after creating entity, and remove "(Client)" etc from name finally! 2021-08-26 18:58:25 +01:00
436607a305 Added some class dependencies which were missing 2021-08-26 17:56:44 +01:00
c7d36df842 Added actor-case relation 2021-08-26 17:55:07 +01:00
8cb50d271b removed config from opencase_defaults 2021-08-26 16:41:12 +01:00
3dcd37bb8c removed circular module dependency 2021-08-07 14:55:52 +00:00
8816441f94 Added custom field formatter to exclude current organisation from entity reference list 2021-07-20 17:09:06 +02:00
73d9d6490a Added redirects to client screen after adding or deleting a linked client 2021-07-20 14:48:50 +02:00
d151b1744e Added Organisation Relation entity with update hook to install it, bumped version 2021-07-16 17:32:40 +02:00
26d78a4f7f Made person's address fields form- and view-configurable, and bumped version 2021-06-29 09:21:04 +02:00
41505594be Added website field to org, and bumped version (to 2.0.0 because ran out of numbers) 2021-06-15 20:13:42 +02:00
3f3945f9a0 Added base field "contact role" to organisation, and bumped version 2021-06-15 19:55:45 +02:00
1cb3a4356a Removed it again - it's the wrong place for it. 2021-06-04 17:45:13 +02:00
34ac278a2e added menu item for managing tags. 2021-06-04 17:40:11 +02:00
b7cfaa9f64 Removed contextual menu block, as it does not work (keeps disappearing). 2021-04-14 11:36:00 +01:00
0df9cfecc8 Added some css classes to the contextual menu, and a temporary css hack. 2021-04-05 19:43:46 +01:00
27f0b33faa Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase 2021-03-23 18:27:19 +00:00
998f72f505 Merge branch 'dev' 2021-03-23 18:25:40 +00:00
4ac33273b9 Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase 2021-03-23 16:47:53 +01:00
99e57d9747 Merge branch 'dev' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase into dev 2021-03-09 10:27:26 -08:00
1d257538fe Changed how destination is set in contextual menu 2021-03-09 10:27:02 -08:00
62a3df034e css 2021-02-22 18:44:42 +01:00
df44524498 css 2021-02-22 18:28:02 +01:00
8d5dda3a7a css 2021-02-22 18:15:30 +01:00
74fac415c8 misc 2021-02-22 11:38:45 +00:00
20cc8cd753 removed EVA stuff from template, plus misc 2021-02-20 15:09:58 +00:00
4647ef6e3e Added equal opps view, and other changes. 2021-02-18 16:46:59 +00:00
1a7757394e Added fields to equal opps entity 2021-02-18 16:10:03 +00:00
fbdc64de3c Added equal opps entity 2021-02-18 15:32:10 +00:00
34a2d9e23b fixed typo kind of thing 2021-02-18 13:33:01 +00:00
bc98ecb541 fixed some issues caused by c&ping from opencase_entities 2021-02-18 12:02:25 +00:00
0f0281c58c Merge branch 'dev' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase into dev 2021-02-14 13:19:14 -08:00
c65012315d css 2021-02-14 13:18:36 -08:00
715f5f34c4 Removed "Entered by" from actor view display 2021-02-14 21:14:33 +00:00
403965fe6f removed error logging, also did something with the search, which now works 2021-02-14 12:39:38 +00:00
eec5b876a3 removed password strength message 2021-02-09 18:26:09 +00:00
077455b4d3 wording on linked person field 2021-02-09 11:05:55 +00:00
7a995060ce Changed max length of full name, and some other things 2021-02-08 21:28:15 +00:00
9646e216aa moved file back into opencase_entities that I had moved by mistake 2021-02-08 17:47:13 +00:00
5afbeb956b Moved everything relating to cases into opencase_cases module 2021-02-08 17:27:18 +00:00
2895dcdab8 help text 2021-02-08 16:14:17 +00:00
3dd71bf2c0 Added full_name field to actors, and made the administer entities permission finer grained 2021-02-08 13:38:54 +00:00
6fbaf433e8 changed "description" label to "notes" 2021-02-07 15:23:46 +00:00
4639ff7ffd css 2021-02-07 15:16:25 +00:00
4285e1952f Added fields to bank account entity 2021-02-07 12:02:47 +00:00
eee7604440 Added Bank Account entity. 2021-02-07 11:59:17 +00:00
0399c83646 made name fields configurable for form and view 2021-02-05 13:47:52 +00:00
2bc1abc7a7 Deleting activity in "No Cases" mode should redirect to first linked person, and other changes 2021-02-05 13:43:11 +00:00
06937b7443 Fixed block config that had gone weird 2021-02-01 17:10:44 +00:00
6d281625b7 Made "opencase_cases" and "opencase_no_cases" modules and gave the latter a version of the contextual menu 2021-02-01 16:49:49 +00:00
208240badc removed support menu as the docs are out of date 2021-02-01 14:33:19 +00:00
c479e3b995 Added "owner" functions to OCEvent.php as it was erroring without them 2021-01-28 16:32:28 +00:00
517938ab7b Added description field to event 2021-01-28 11:54:07 +00:00
b48ba012cb Added Event entity type. 2021-01-28 10:22:20 +00:00
53648faff7 composer require drupal/smtp 2021-01-25 19:02:21 +01:00
a993e09bc6 required paragraphs_collapsible module 2021-01-25 16:23:16 +00:00
3aa4fbc5cf Redirecting to home page after deleting organisation 2021-01-25 15:41:22 +00:00
0caf2cb7c8 Edited case template to put EVA fields at the bottom 2021-01-25 14:07:26 +00:00
e49ad3fc9c Edited template to place "EVA" fields (embedded views) at the top of case page. 2021-01-23 18:12:35 +00:00
146eb2b8ba Adding requires to composer.json 2021-01-21 19:05:52 +00:00
360fe56a6d Update 'composer.json' 2021-01-20 13:58:35 +01:00
91cc94d3d7 Added composer.json 2021-01-20 13:44:33 +01:00
2b9cd117ba Added files field to organisation (base field definition and update hook) and bumped version to 0.198 2021-01-19 15:55:18 +01:00
36eb9d9667 field positions 2020-11-20 17:42:25 +00:00
d026173c8f moved activities view to opencase_default 2020-11-20 17:36:51 +00:00
7ecdfbf3e6 changed field order 2020-11-20 14:19:22 +00:00
113ff6361b moved entity type relations widget into opencase_defaults 2020-11-20 12:04:22 +00:00
ca1a0eda29 Merge branch 'master' of ssh://git.autonomic.zone:2222/autonomic-cooperative/opencase 2020-11-20 11:03:19 +00:00
dfb12d9be6 moved consent field to opencase_defaults and removed automatic "see all people" menu links 2020-11-20 11:00:52 +00:00
ea71314345 Deleted composer.json, not needed with new install instructions 2020-11-19 18:39:28 +01:00
31be127d30 Update 'docs/install.txt' 2020-11-19 18:38:41 +01:00
7c5ee54a44 changed machine name of view from actors to persons 2020-11-18 12:58:39 +00:00
21528a436e changed field description 2020-11-17 12:26:39 +00:00
ffb99bcac6 removed see-all-organisations menu stuff 2020-11-17 12:14:24 +00:00
a7f0e8fb02 removed all-cases menu link 2020-11-17 12:03:36 +00:00
eb405674dc moved cases view into defaults(thought was done already) 2020-11-17 11:58:14 +00:00
342459daa3 removed dependency of opencase module on opencase_search 2020-11-17 11:52:44 +00:00
cde0bbc7e6 moved actors_involved field to defaults 2020-11-17 11:24:18 +00:00
aff262a535 moved everything that references cases view into defaults 2020-11-17 11:09:17 +00:00
0d927126a2 moved contextual menu stuff into defaults 2020-11-17 10:55:16 +00:00
2f485f19c5 moved cases menu link and title overrides into here
They were previously in opencase itself but are not needed for GNO
2020-11-17 10:51:27 +00:00
8b07bbe63f Removed author field and simplified case title field 2020-11-17 10:47:24 +00:00
690ec3b509 Put cases menu link back, and some other things 2020-11-15 17:39:50 +00:00
7a9b95bf0d Wiring up new Organisation entity type 2020-11-12 17:35:34 +00:00
675a85dfb6 generated Organisation entity 2020-11-12 17:13:28 +00:00
17f8ddba2e contextual menu parameterised 2020-11-10 13:42:32 +00:00
27cb58512e Added menu links for seeing lists of things, also updated install.txt 2020-11-09 17:50:09 +00:00
df2c826a33 moved some menu links around for modularity 2020-11-09 16:18:14 +00:00
6f33d59842 changed "Cases" menu label to "See all", as will add more things 2020-11-09 14:49:17 +00:00
e37a41de2b opencase version in composer.json 2020-11-09 12:48:19 +00:00
c47df855bc Docs 2020-11-09 12:43:53 +00:00
af3b4727f1 Added some docs 2020-11-09 12:36:08 +00:00
011029d3b3 moved some menu code around for better modularisation 2020-11-08 18:05:24 +00:00
9af1d58de8 removed "details", see `https://drupal.stackexchange.com/questions/294312/why-has-this-details-accordion-appeared-in-this-view 2020-06-08 20:43:51 +01:00
6d93242fa9 v1.9.2 2020-06-08 14:22:04 +01:00
c9a843a35f (Re-)Added update hook to make contact details revisionable 2020-06-08 14:21:16 +01:00
c46bbc6ffd v1.9 2020-06-05 19:34:44 +01:00
5d1844304a templating for activities 2020-06-05 19:26:59 +01:00
be45fd2d42 sorting by date-and-time in activities view
Also removed date format thing from hook_update_n as not needed
2020-06-05 18:41:46 +01:00
18a0846348 Added name and status changes view
and did some other things, can't remember what
2020-06-05 18:36:14 +01:00
18e32335f5 In progress of adding revision views & making entity displays nicer 2020-05-13 15:41:59 +01:00
b83f0b44b4 v1.7 - Removed seconds from date and time field
Also altered activities view to show this field instead of created date.
2020-03-01 09:45:10 +00:00
7f88d409f0 1.6.5 more git mixup 2020-02-24 17:17:53 +00:00
8841fd4d25 v1.6.4 - more git mixup 2020-02-24 17:09:57 +00:00
87241c1f87 v1.6.3 due to git mixup 2020-02-24 16:59:43 +00:00
2a1607c6d9 Merge branch 'master' of github.com:hoegrammer/opencase 2020-02-24 16:27:37 +00:00
d8fd12a7b9 v1.6.2 2020-02-24 16:27:18 +00:00
e4a04a254d v1.6.1 2020-02-24 16:26:04 +00:00
88b5ce3d2e Merge branch 'master' of github.com:hoegrammer/opencase 2020-02-24 13:01:15 +00:00
ae3976c7b8 Improved new activity date & time field, also...
* Removed dependency of opencase_search on opencase so opencase_search doesn't get uninstalled when refreshing opencase for UI changes
* Changed no-results wording on case views (both displays: all cases & cases for a person)
2020-02-24 12:54:39 +00:00
f47ded38fa v1.7 - adding datetime field with correct datepicker type & default datetime 2020-02-24 10:57:06 +00:00
c63cae6b71 Added callback to default to current date
But it isn't displaying, possibly because of having the wrong kind of widget
2020-02-23 17:36:48 +00:00
a7a96ab03c v1.6 Added activity date time field 2020-02-22 15:31:10 +00:00
a6db6615df No longer trimming activity text in views 2020-01-23 10:04:50 +00:00
1c3370a784 different header text for case view 2019-11-27 10:04:10 +00:00
59f4987371 Uninstall code for some config items that were being left in 2019-11-11 11:14:57 +00:00
c1e24593fa limiting involved parties facet to non-clients. 2019-07-15 20:34:32 +01:00
c98f028045 Removed ajax from views
Although it is beautiful, it stops the export from being filtered.
2019-07-15 19:51:57 +01:00
873f751795 Added config files for reporting on cases
And moved indexes to optional config so as not to have to keep
rebuilding them
2019-07-15 18:36:53 +01:00
6b9ff3a5e7 typo 2019-06-09 15:26:29 +01:00
b24ba377d2 removed dependency no longer required 2019-06-09 14:27:59 +01:00
33168ecb62 Added new module, Opencase Default Reporting 2019-06-09 14:00:23 +01:00
3eacbc952f Moved some configs from here into new module, Opencase Default Reporting 2019-06-09 13:58:39 +01:00
47ea8493ce added a permission to delete people 2019-04-29 16:44:34 +01:00
eb6cfb89dd removed old commented-out permissions
that had been superseded by the dynamic permissions
2018-12-19 09:13:20 +00:00
94e2635ee1 Hopefully fixed OSIC level reporting bug. Config to delete:
- Volunteer reporting index.

Not sure how, I fixed it, just re-created everything
2018-12-18 15:32:53 +00:00
fa7516b03a Menus other than "support" not available when logged out. 2018-12-15 14:21:38 +00:00
bfa4f27cf7 Items per pages on views. Manual changes needed
- delete volunteer report view
2018-12-15 14:07:15 +00:00
36aff5564e menu link text, Just needs a cache clear 2018-12-15 14:02:53 +00:00
e0260256fa Actor -> Person. Need to update entities 2018-12-15 14:00:26 +00:00
fd47bee26a Added "sex" field. Optionally change config:
- Add to form and view display for client (optional)
2018-12-15 13:53:35 +00:00
150cc6cfd1 Data export. Config changed (some from previous commits):
- view - cases
- view - reporting_clients
- view - reporting_volunteers
- block - nationalities
2018-12-15 13:41:13 +00:00
44c948d22a Added instructions for adding new case to cases view 2018-12-15 13:25:22 +00:00
99733415c8 Facet block config 2018-12-15 13:16:37 +00:00
5e127358b2 Added some css and a list of nationalities for the dropdown 2018-12-15 11:34:59 +00:00
9a937e2d46 Changed minimum count to 0 on all facets
which means the checkboxes don't disappear when there are none of that kind in the search results.
Also changed how name is displayed in reporting view
2018-12-14 19:02:20 +00:00
e45cbb6a76 Changed permission for admin menu
because on demo, site-admin can configure entities but not manage users
2018-12-14 18:52:35 +00:00
ca04c3e259 Replaced text-box "nationality" field with drop-down "nationalities" 2018-12-14 18:51:45 +00:00
658ba667b1 updated readme for 0.4.2 2018-11-11 20:19:17 +00:00
309a31e012 tidied up menu code, made parent not open on click 2018-11-11 19:58:32 +00:00
8ccd0313a7 Added missing config file 2018-11-09 16:44:08 +00:00
ab2662195b Replaced config removed by mistake 2018-11-09 16:39:52 +00:00
b81d6b5f31 Removed config for disused menus 2018-11-09 16:38:00 +00:00
ad6811b5e9 Changed "Actor" to "Person" in a few places 2018-11-09 16:14:48 +00:00
da0c0ff1b5 More on menu 2018-11-09 15:56:03 +00:00
3e6011a359 menu order 2018-11-09 15:03:34 +00:00
7e28f88b86 Shiny new menu at top of screen! 2018-11-09 14:59:25 +00:00
0efab1af06 Moved search bar to top, and styled
Also add opencase_search as dependency to opencase because the css for it is in opencase/css (hopefully all this css can go into an opencase theme one day)
2018-11-09 13:16:47 +00:00
4b14537dc4 Renamed config file in line with id 2018-11-08 18:58:44 +00:00
52eb5898e3 Removed duplicate configs, and added dependency 2018-11-08 18:47:24 +00:00
acf3e704cc Added a commented out bit of code for automatic permissions 2018-10-26 11:23:21 +01:00
142c22f8e2 Dynamic permissions! 2018-10-25 19:47:12 +01:00
570d442d41 Minor change to wording 2018-10-25 18:32:26 +01:00
981439d3c6 Added "use opencase" permission to all roles 2018-10-25 18:28:25 +01:00
0333e20afd Added form and display config permissions to crm admin 2018-10-25 18:26:31 +01:00
ec25af3858 Confined rogue OSIC Level facet to reporting/* 2018-10-25 18:14:00 +01:00
30a4d13081 Date format for dob for client.
Also removed some other fields that I'm not sure why were there...
2018-10-25 17:55:39 +01:00
904cf2d63c Explicity stop OSIC Level facet from apearing on home page
God knows why but it was doing
2018-10-25 17:45:37 +01:00
78a44718fb Added activity type help block 2018-10-25 14:55:42 +01:00
7c30d9d02e postcode weight 2018-10-25 14:55:25 +01:00
fdd07ea104 Added help block for managing actor type fields 2018-10-24 18:24:20 +01:00
10b99f132e Dynamic menu links for adding actors 2018-10-24 17:40:26 +01:00
fd5d145866 Added volunteer supervision activity type 2018-10-24 17:39:56 +01:00
530df37e92 removed cases link from reporting menu 2018-10-24 16:51:22 +01:00
7fd551982d Added OSIC level facet to volunteer report 2018-10-24 16:48:00 +01:00
0aa6b92490 Added a bunch of facets 2018-10-24 16:16:35 +01:00
b62f2f34a9 Bodged download button for reporting. 2018-10-24 16:16:17 +01:00
8187f6b306 Finished client reporting 2018-10-01 18:55:51 +01:00
56be669fe9 Fixed the jQuery on the download data button
The click binding was getting lost after ajax reload
2018-10-01 17:55:41 +01:00
5cde32c975 Added reporting menu with one link for Custom Report 2018-10-01 14:58:00 +01:00
bfef673d42 Simplified reporting. Presets will be hard coded 2018-10-01 14:35:10 +01:00
9f735eb492 Deleted a bunch of stuff to do with report entities
because we are not using them at this stage
2018-10-01 10:41:32 +01:00
a8c454c509 Made all base fields on actors not configurable
Making them configurable seems to mess up weights and stuff.
2018-09-19 09:15:42 +01:00
9424aca1e9 Added config for "skills" field on volunteer. 2018-09-19 09:15:19 +01:00
b5f718647e Using views for CRUDding saved reports. 2018-09-17 18:49:20 +01:00
7e1889346b newly generated content entity. 2018-09-17 17:29:04 +01:00
1e0a6a41d3 got rid of reference to the report config entity 2018-09-17 17:26:40 +01:00
e14a68ef62 removed "report" config entity
so as to try out making it a content entity instead.
2018-09-17 17:23:03 +01:00
c48f58d49b Added block plugin for report form, to show on reporting page. 2018-09-17 17:21:31 +01:00
7a61f76a93 Minor changes to reporting forms 2018-09-17 12:24:43 +01:00
354bb0adba paths and permissions for report entities. 2018-09-17 09:26:30 +01:00
e02721217b Added "Use OpenCase" permission 2018-09-17 09:09:38 +01:00
d5fe23418e Saved reports (templates) are now just called "reports". 2018-09-17 08:48:20 +01:00
c81ebc4d94 Fixed field type error 2018-09-14 13:59:35 +01:00
7fbc35915c made reporting export url match page url (it works!) 2018-09-12 18:24:48 +01:00
987adc97ce Reporting buttons area. Data download button 2018-09-12 18:16:36 +01:00
3faabda3f2 minor changes to reporting stuff 2018-09-12 16:48:23 +01:00
eb6356f715 removed schema file because I think it is not used. 2018-09-12 16:22:02 +01:00
92cec4c513 added 100% body font size to opencase css 2018-09-12 15:57:18 +01:00
e5db0007c9 Started on Reporting Presets block. 2018-09-12 15:50:08 +01:00
cc108076bb Added reporting menu item to config. 2018-09-10 19:31:11 +01:00
714ceeb3d0 sort order of facet items, and a typo 2018-09-10 19:24:39 +01:00
0371c37786 Added required tickbox, "consent to data storage" 2018-09-10 18:38:55 +01:00
e1e40bc8ad Search now uses, and displays, first and last name and type
where previously it was the name thing with the type included
2018-09-07 12:57:02 +01:00
9b9bce4bc4 Reporting Actors view now takes query parameter for title 2018-09-07 12:48:47 +01:00
1d86b2a5bc Minor edits to reporting view and facets 2018-09-07 12:37:39 +01:00
ee5c82cb0b removed case type filter from home cases view
because it was not asked for and looked ugly.
2018-09-06 19:53:41 +01:00
20b3ff0cd4 CSS for facet labels 2018-09-06 19:33:47 +01:00
393ce2501c Added a basic index, view & facets for reporting
it is not a useful report, but it doesnt rely on defaults. It's just so that I can work on the reporting without the defaults. General stuff like css and preset support will not be dependent on the defaults. By the time this is properly released, I will have developed a way of generating what is needed for reporting automatically.
2018-09-06 19:11:49 +01:00
2be2cc7837 Added reporting server and index
The index does not rely on any default config.
2018-09-06 17:17:52 +01:00
e45d49e299 Added reporting server config to reporting module 2018-09-06 16:57:39 +01:00
51db7f00d4 Can search on partial names now, need at least 3 letters. 2018-09-06 16:57:13 +01:00
e5da065d0c Changed names of server and index for search
because now we will have ones for reporting as well
2018-09-06 16:38:00 +01:00
14575008d6 Added bare-bones reporting module.
Plus a minor change to search module description
2018-09-06 16:30:58 +01:00
8e43ad637d Added dependency on opencase module to opencase_search
... because the search view has links to other views. Also added some missing configs to the uninstall hook in opencase.module.
2018-09-06 16:27:14 +01:00
d5e767ea9f Update README.md 2018-07-24 10:26:53 +01:00
f97c43bbb2 Update README.md 2018-07-24 10:26:08 +01:00
ac92336b0e removed dependency of linked actor field on vol 2018-07-24 10:43:55 +02:00
bc77e1995d Update field.field.user.user.field_linked_opencase_actor.yml 2018-07-20 11:34:53 +01:00
fd661f6a2f added some config that was missed / wrong 2018-07-19 20:01:59 +02:00
679f40c16d linked actor field config added 2018-07-19 19:13:08 +02:00
ebd755d86c search view: changed no-results wording &cache off 2018-07-19 16:48:03 +02:00
c507fb29b7 changed no-results wording in views 2018-07-19 16:47:16 +02:00
af0040479e added the actual menu as well as the block 2018-07-19 16:46:23 +02:00
3198c00f5a Added add-actors block which was missing 2018-07-19 16:45:31 +02:00
2e40dc46f2 removed view caching 2018-07-19 16:29:56 +02:00
7a21352ac4 activity view query permissions. 2018-07-19 16:22:26 +02:00
8b274c0d6c Changed some permissions 2018-07-19 15:56:57 +02:00
775a08319c if you cancel a delete it now goes back to entity
like duh why didn't it just do that by default
2018-07-19 15:51:52 +02:00
352ea000f0 More on permissions for activities and cases 2018-07-19 15:35:22 +02:00
ec99009f16 Added access control for viewing activity
Can only view activity if involved in the case.
2018-07-19 15:10:02 +02:00
d2bd27c960 added another null check to contextual menu 2018-07-19 14:23:44 +02:00
b5f567f872 changed contact form address to aktivix
because gmail is giving ipv6 errors
2018-07-19 13:54:09 +02:00
221d16c7fa removed label from contextual menu block 2018-07-19 11:39:15 +02:00
6b3b744900 Added contact form to opencase_defaults 2018-07-19 11:35:43 +02:00
1c0195a632 Redirects to activity list on deleteing activity 2018-07-18 22:39:27 +02:00
a47a06aef3 Gave site admin various permissions 2018-07-18 22:21:22 +02:00
33feac1977 redirect to home after deleting case or actor
also changed contextual menu code for cases when the actor whose case it is has been deleted
2018-07-18 22:15:45 +02:00
ddab3e450a fixed bug where case list link not generated 2018-07-18 21:06:26 +02:00
e588a70a1b Added configs (didn't do that last commit) 2018-07-18 20:15:57 +02:00
c0c415e691 New config for asylum status and language. 2018-07-18 20:05:27 +02:00
6c384605ec removed old asylum and language fields
and associated config
2018-07-18 19:59:51 +02:00
09650469bf Only those with "administer users" can link actor 2018-07-18 12:06:22 +02:00
48dabf1701 minor change: null check 2018-07-17 16:19:25 +02:00
08fe6dc362 added code to remove exposedfilter when view empty 2018-07-09 20:38:48 +02:00
3f01a3ad41 typo 2018-07-09 20:31:20 +02:00
d589ef8d69 premission description 2018-07-09 20:29:25 +02:00
a267e222b8 Removed the "view own cases" permission
Now everyone sees cases they are involved in, they don't need a special perm.
2018-07-09 20:26:11 +02:00
910350699d Added 'view label' access bypass to actors
Was therefore able to get rid of the "view volunteer involvement in cases" stuff which was complicated
2018-07-09 20:15:16 +02:00
c729750705 Case views are now filtered by user involvement
unless the user has the see all cases permission
2018-07-09 19:36:47 +02:00
351bdb5afd Added "own cases" permission and access check
Works for when viewing a single case, not for view yet though.
2018-07-09 13:21:52 +02:00
2a31b1c8ce added linked actor of logged in user to new case 2018-07-09 12:11:07 +02:00
667b109de8 removed client from volunteer engagement 2018-07-09 11:32:12 +02:00
92d4f74ad7 fixed a sed mistake 2018-07-09 11:22:38 +02:00
487415c679 Another attempt to fix the "plugin does not exist" 2018-07-09 11:21:09 +02:00
7bf0f67a06 Added a bunch of config, apparently wasn't in git 2018-07-05 17:57:10 +02:00
8dc840a53d Made ALL of opencase_defaults config optional.
The idea is you can install it, and use as a basis to configure your own things and then if you uninstall it it shouldn't lose your stuff.
2018-07-05 17:11:32 +02:00
288751274b Moved more contact form config. 2018-07-05 16:16:42 +02:00
aa130aeede moved more contact form config to main module 2018-07-05 16:15:18 +02:00
f373ac419e Added menu links for "add actors" menu to defaults
Because it has hard coded bundles.
Also remove some config files that were not needed any more.
2018-07-05 16:09:57 +02:00
b1d5c4eddf Moved contact form to opencase module
Using optional config.
2018-07-05 16:07:34 +02:00
6c6c6d5c92 Added menu link config to opencase module.
For opencase-admin and openc (OpenCase Global) menus.
2018-07-05 15:56:19 +02:00
73e7ff2656 Uninstall hook in opencase module
Also moved more config files about.
2018-07-05 14:05:50 +02:00
8dd56d5b51 OpenCase Search module - uninstall hook working. 2018-07-05 13:55:45 +02:00
d229e02f67 moved search config into its own module. 2018-07-05 13:22:45 +02:00
7ef0628bd6 Deleted features, moved everything into submodules. 2018-07-05 12:29:09 +02:00
5863fb7faa moved some files around
trying to organise what was features into submodules
2018-07-05 12:24:14 +02:00
36939720fe User roles as well as bundles are now in module
opencase_defaults... also changed its title
2018-06-29 16:30:05 +02:00
7e04836ff1 Moved bundle configs from feature into module 2018-06-29 16:23:12 +02:00
b28c7a3f5d removed opencase_search module
it wasn't doing anything - the feature is what does stuff
2018-06-29 15:52:39 +02:00
5688f89857 removed dependency of opencase on opencase-search 2018-06-29 15:38:43 +02:00
cf0078d1be removed date format configs
easier than working out how to override them
2018-06-29 15:12:39 +02:00
f4c3512501 straighforward bugfix 2018-06-29 14:51:12 +02:00
4c7cd2067b Made new module, "opencase_defaults".Added a role 2018-06-29 13:04:35 +02:00
a0ab7282b8 Added bundle labels to cases & activities views
This involved creating access control handlers for cases and activities (also did one for actors for good measure) and regenerating the opencase_features_opencase_ui feature so as to add the "type" field to the views
2018-06-18 18:15:00 +02:00
12afa00df8 Added permission for configuring opencase bundles 2018-06-18 17:11:45 +02:00
1878d1e2fd fixed bugs in entity type relations/widgets 2018-06-18 16:29:24 +02:00
050bee1a9b added /vender to .gitignore 2018-06-18 15:23:04 +02:00
d46142ee2b finished entity type relations 2018-06-13 17:51:14 +02:00
fd1a0d5156 Allowed activity types are a property of case type 2018-06-13 16:29:21 +02:00
e601fde1ef Refactored case-type - client-type relationship
and corresponding part of widget
2018-06-13 13:31:04 +02:00
74b6f90c94 Entity relations working in all directions 2018-06-12 18:12:30 +02:00
e10096c1ca Relations between case type and actor types done 2018-06-12 17:16:40 +02:00
8941cdfb49 refactoring 2018-06-12 16:11:28 +02:00
9715401dfc Factored actor type widget stuff into a class 2018-06-12 15:38:30 +02:00
7448048f2d Changed default value of Involved Parties to array 2018-06-12 14:11:35 +02:00
48e5080a9c Relation between case types and actor types
Allowed actor types for a case are saved in a base field override for the "involved parties" field.
2018-06-12 14:02:09 +02:00
cba43a04e5 Added config for relatin case types to actor types 2018-05-28 16:21:56 +02:00
ce1d3ca38b CSS'd out the new revision checkbox
I ultimately want to keep it, but will reinstate when I find a way of putting it somewhere sensible on the page
2018-05-28 15:24:15 +02:00
8294a9647f Added access control to activities view
Just auth user for now
2018-05-28 15:14:18 +02:00
c261552cc1 Added private files setting to case entity 2018-05-28 15:11:06 +02:00
2708b0193d Added feature config 2018-05-13 15:42:16 +02:00
5e6f1e01c4 updated readme 2018-05-13 13:48:00 +02:00
54c3895eb0 Merged mass deletion, now will add back the new code 2018-05-13 13:44:58 +02:00
20ab150226 Add-case form counts as "case context" 2018-05-13 13:44:27 +02:00
c31706467a updated readme 2018-05-13 14:42:03 +03:00
57a797ba6d deleted all the things.
backup is in old_code branch
2018-05-13 14:26:11 +03:00
85260daa0e typo 2018-05-11 14:43:42 +02:00
f2e7e8b6be Removed " see client involvement in cases" perm
It doesn't make sense - someone who can't see clients shouldn't see client cases at all.
2018-05-11 13:25:47 +02:00
b8e49fb9cb Added "time taken" base field to activity
Also removed case field from activity display. It is in the sidebar, no need to have it twice.
2018-05-11 13:19:28 +02:00
98d856303a minor bugfix 2018-05-11 11:55:26 +02:00
d8aaacec2d Added contact details to actor 2018-05-08 20:44:08 +02:00
e2f77bf301 case base field descriptions 2018-05-08 19:26:33 +02:00
83264f93b2 css to remove search button 2018-05-08 19:23:03 +02:00
eae1a2b03d Removed global menu block - using a menu now
because the menu function automatically handles showing you only the links you have permission to traverse
2018-05-08 18:31:11 +02:00
53507dae33 minor bugfix to contextual block 2018-05-08 18:30:39 +02:00
b8bba0b332 tiny bugfix on bundle permissions 2018-05-08 16:10:00 +02:00
7dba72ef66 Added permissions for client and volunteers
Plus permission to see just their involvement in cases
2018-05-08 15:41:02 +02:00
1eb54e69e5 Put the actor id in the session
instead of passing it around like mad in url queries
2018-05-08 14:54:11 +02:00
c151f84692 In contextual menu, passing through actor_id
so that we can always come back to the original actor
2018-05-08 14:09:26 +02:00
80f42c7bf3 Added case list link to add-new-case page 2018-05-08 13:21:12 +02:00
555087f3b2 Cropped the top off the logo so it sits higher 2018-05-08 11:52:37 +02:00
f770659cef Tidied base fields 2018-05-07 19:54:30 +02:00
1786fce0e8 Added hook so as not to show empty contextual menu 2018-05-07 19:20:27 +02:00
a43aa0dc08 Added css and js
CSS file is empty as yet, but js has thing to remove autocomplete from search box
2018-05-07 18:54:08 +02:00
588b159dbd Added hook to open external menu links in new tab 2018-05-07 18:31:24 +02:00
c28e048db0 Added logo 2018-05-07 15:20:15 +02:00
7dc3e5d563 Added "files" as base field on case 2018-05-07 15:04:01 +02:00
18d0303f54 Moved base fields around
Because you can't make it put them at the bottom, so I have given them all negative weights so they go at the top and the custom fields start at 0. User is at the top
2018-05-07 14:49:31 +02:00
c1c981fddd Modified page titles to give more info
Also removed conditional link back to case list from a case - it only appears sometimes, so it is more confusing to have it than not.
2018-05-03 14:34:55 +02:00
c909a51c1c minor change to entity display 2018-05-03 14:11:04 +02:00
abd6ee896b Added more nav links to contextual menu block 2018-05-03 14:06:01 +02:00
0c9377f48e Refactored global and contextual menu 2018-05-03 13:35:35 +02:00
b89cfcc2ee Added link to case list, when viewing case
It relies on the referer, and isn't very good.
2018-04-30 18:30:43 +02:00
7cf4ee557b New activity gets its case from the url 2018-04-30 17:14:51 +02:00
59964e653e Added Utils class and refactored 2018-04-30 16:49:44 +02:00
3b7e8c9cbe When creating case, first actor is set from URL
And the contextual menu adds the query string
2018-04-30 15:45:34 +02:00
fc1ae79562 Added contextual menu block 2018-04-30 14:24:01 +02:00
fc982f8376 Added actors field to case & and case to activity 2018-04-30 12:59:07 +02:00
9d8c6a34d9 Changed paths so non-admin paths are /opencase/* 2018-04-29 15:23:15 +02:00
469f2413ec Actor entity label now includes subtype 2018-04-29 14:54:28 +02:00
900ba263c7 Actor name field is now set to full name on save 2018-04-29 14:50:41 +02:00
76f61b16b7 Added first, middle and last name fields to actor 2018-04-29 14:44:52 +02:00
4b7f983b27 Generated OpenCase Search module 2018-04-29 14:38:10 +02:00
249003bf16 Made Actor, Activity and Case entities 2018-04-29 13:58:46 +02:00
398a6c71a3 Re-generated OpenCase Entities module 2018-04-29 13:52:36 +02:00
03846a27f7 Generated opencase and opencase_entities modules 2018-04-29 09:22:16 +02:00
0dceb8c38d Added an access role to views
Just made it "authorised user" for now, to keep the security review happy
2018-04-27 19:18:14 +02:00
d21109ebca Added hat types permission
It kind of works, as it allows the user to add, "edit" and delete hat types - but it does not allow administrating fields
2018-04-27 16:10:10 +02:00
7097cac863 Removed redirect to home page after login
The way it was done, it didn't work with password reset
2018-04-27 16:09:38 +02:00
439 changed files with 19606 additions and 7287 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.swp
vendor

View File

@ -1,17 +1,36 @@
# OpenCase
A simple, case-management-focused CRM for small altruistic organisations.
## Current Status
**15 April 2018** A demo site, with basic functionality is available at demo.opencase.org.uk.
A simple case-management system
## The Plan
OpenCase will be available as:
* A Drupal module, on drupal.org
* A Drupal install profile / distribution
* A hosted service
### Features
#### Existing
* Completely configurable person types, case types and activity types
* Search
* Basic Reporting
* Basic user roles (caseworker, volunteer co-ordinator, site admin etc) with access control
#### Coming soon
* Better reporting (currently only reports on defaults fields and not user-added ones)
* Allocation of tasks, overview of tasks and their stage of completion
* Appointments and notifications
## Current Status
**11 Nov 2018**
### User Base
OpenCase is being used by a couple of organisations, early adopters on the hosted platform.
### Availability as Free Software
If you want to install OpenCase for yourself, please get in touch via Issues. It is changing rapidly and the install process is currently undocumented but I am more than happy to guide you through.
### Try it out
A demo site, with basic functionality is available at demo.opencase.org.uk. If you are interested, raise an issue and I will get the login to you somehow.
## Find out more
* More details, including user stories, can be found in the [OpenCase Gitbook](https://hoegrammer.gitbooks.io/zen-crm/content/)
* More details, including user stories for future development, can be found in the [OpenCase Gitbook](https://hoegrammer.gitbooks.io/opencase/content/)
* Raise an issue to contact the developer.

View File

@ -0,0 +1,5 @@
ciac_grouped_views:
version: 1.x
css:
layout:
css/grouped_views.css: {}

View File

@ -1,14 +1,17 @@
{
"name": "drupal/zencrm",
"type": "drupal-module",
"description": "Zen CRM",
"keywords": ["Drupal"],
"license": "GPL-2.0+",
"homepage": "https://www.drupal.org/project/zencrm",
"minimum-stability": "dev",
"support": {
"issues": "https://www.drupal.org/project/issues/zencrm",
"source": "http://cgit.drupalcode.org/zencrm"
},
"require": { }
"name": "autonomic/opencase",
"type": "drupal-module",
"authors": [
{
"name": "autonomic",
"email": "helo@autonomic.zone"
}
],
"require": {
"composer/installers": "*",
"drupal/superfish": "*",
"drupal/views_autosubmit": "*",
"drupal/smtp": "*",
"drupal/paragraphs_collapsible": "*"
}
}

View File

@ -2,24 +2,24 @@ langcode: en
status: true
dependencies:
module:
- opencase
- system
- zencrm
theme:
- bartik
id: activitycreator
id: actortypehelp
theme: bartik
region: content
weight: -7
weight: -11
provider: null
plugin: activity_creator
plugin: actor_type_help
settings:
id: activity_creator
label: 'Activity creator'
provider: zencrm
id: actor_type_help
label: 'Actor Type Help'
provider: opencase
label_display: '0'
visibility:
request_path:
id: request_path
pages: '/zencrm/case/*'
pages: '/admin/opencase/oc_actor_type/*/edit/fields'
negate: false
context_mapping: { }

View File

@ -0,0 +1,28 @@
langcode: en
status: true
dependencies:
config:
- views.view.equal_opps_records
module:
- system
- views
theme:
- bartik
id: exposedformequal_opps_recordspage_1
theme: bartik
region: content
weight: 0
provider: null
plugin: 'views_exposed_filter_block:equal_opps_records-page_1'
settings:
id: 'views_exposed_filter_block:equal_opps_records-page_1'
label: ''
provider: views
label_display: visible
views_label: 'Search by (whole) first or last name.'
visibility:
request_path:
id: request_path
pages: /equal-opps-records
negate: false
context_mapping: { }

View File

@ -0,0 +1,69 @@
langcode: en
status: true
dependencies:
config:
- system.menu.opencase
module:
- superfish
theme:
- bartik
id: opencase
theme: bartik
region: primary_menu
weight: 0
provider: null
plugin: 'superfish:opencase'
settings:
id: 'superfish:opencase'
label: OpenCase
provider: superfish
label_display: '0'
level: '1'
depth: '0'
menu_type: horizontal
style: none
arrow: 0
shadow: 1
speed: fast
delay: '800'
slide: vertical
supposition: 1
hoverintent: 1
touch: '1'
touchbh: '1'
touchbp: '768'
touchua: '0'
touchual: ''
touchuam: '0'
small: '2'
smallbp: '768'
smallua: '0'
smallual: ''
smalluam: '0'
smallact: '1'
smallset: ''
smallasa: 0
smallcmc: 0
smallecm: ''
smallchc: 0
smallech: ''
smallicm: ''
smallich: ''
smallamt: ''
smallabt: '1'
supersubs: 1
minwidth: '12'
maxwidth: '27'
multicolumn: 0
multicolumn_depth: '1'
multicolumn_levels: '1'
pathlevels: '1'
expanded: 0
clone_parent: 0
hide_linkdescription: 0
add_linkdescription: 0
link_depth_class: 1
custom_list_class: ''
custom_item_class: ''
custom_link_class: ''
visibility: { }

View File

@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
id: opencase
label: OpenCase
description: 'Main navigation menu for OpenCase'
locked: false

View File

@ -0,0 +1,8 @@
uuid: 85aacc47-8df9-4309-b7f4-f58be70f83d0
langcode: en
status: true
dependencies: { }
name: 'Case Provider Roles'
vid: oc_case_provider_role
description: ''
weight: 0

View File

@ -0,0 +1,8 @@
uuid: 93a96bb4-da95-4d69-be37-d1477624f849
langcode: en
status: true
dependencies: { }
name: 'Fee categories'
vid: oc_fee_category
description: ''
weight: 0

View File

@ -0,0 +1,852 @@
langcode: en
status: true
dependencies:
module:
- opencase_entities
- user
id: contact_details_changes
label: 'Contact Details History'
module: views
description: ''
tag: ''
base_table: oc_actor_field_revision
base_field: vid
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'view published client entities'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: none
options:
offset: 0
style:
type: table
options:
grouping:
1:
field: view_oc_actor
rendered: true
rendered_strip: false
row_class: ''
default_row_class: true
override: true
sticky: false
caption: ''
summary: ''
description: ''
columns:
first_name: first_name
middle_names: middle_names
last_name: last_name
id: id
revision_created: revision_created
view_oc_actor: view_oc_actor
info:
first_name:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
middle_names:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
last_name:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
id:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
revision_created:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
view_oc_actor:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
default: '-1'
empty_table: false
row:
type: fields
options:
inline: { }
separator: ''
hide_empty: false
default_field_elements: true
fields:
revision_created:
id: revision_created
table: oc_actor_revision
field: revision_created
relationship: none
group_type: min
admin_label: ''
label: Date
exclude: false
alter:
alter_text: true
text: '{{ revision_created | date(''d/m/Y'') }}'
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
set_precision: false
precision: 0
decimal: .
separator: ''
format_plural: 0
format_plural_string: !!binary MQNAY291bnQ=
prefix: ''
suffix: ''
click_sort_column: value
type: timestamp
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
field_api_classes: false
entity_type: oc_actor
entity_field: revision_created
plugin_id: field
first_name:
id: first_name
table: oc_actor_field_revision
field: first_name
relationship: none
group_type: group
admin_label: ''
label: 'First Name'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: first_name
plugin_id: field
middle_names:
id: middle_names
table: oc_actor_field_revision
field: middle_names
relationship: none
group_type: group
admin_label: ''
label: 'Middle Names'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: middle_names
plugin_id: field
last_name:
id: last_name
table: oc_actor_field_revision
field: last_name
relationship: none
group_type: group
admin_label: ''
label: 'Last Name'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: last_name
plugin_id: field
email:
id: email
table: oc_actor_field_revision
field: email
relationship: none
group_type: group
admin_label: ''
label: 'Email Address'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: email
plugin_id: field
phone:
id: phone
table: oc_actor_field_revision
field: phone
relationship: none
group_type: group
admin_label: ''
label: 'Main Phone Number'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: phone
plugin_id: field
phone2:
id: phone2
table: oc_actor_field_revision
field: phone2
relationship: none
group_type: group
admin_label: ''
label: 'Alternative Phone Number'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: phone2
plugin_id: field
postal_address:
id: postal_address
table: oc_actor_field_revision
field: postal_address
relationship: none
group_type: group
admin_label: ''
label: 'Postal Address'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: basic_string
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: postal_address
plugin_id: field
post_code:
id: post_code
table: oc_actor_field_revision
field: post_code
relationship: none
group_type: group
admin_label: ''
label: 'Post Code'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: oc_actor
entity_field: post_code
plugin_id: field
view_oc_actor:
id: view_oc_actor
table: oc_actor_field_revision
field: view_oc_actor
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: true
alter:
alter_text: true
text: "◀\tBack to current record"
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
text: 'See "rewrite results" (had to do it that way because contains HTML).'
output_url_as_text: false
absolute: false
entity_type: oc_actor
plugin_id: entity_link
filters: { }
sorts:
revision_created:
id: revision_created
table: oc_actor_revision
field: revision_created
relationship: none
group_type: min
admin_label: ''
order: DESC
exposed: false
expose:
label: ''
granularity: second
entity_type: oc_actor
entity_field: revision_created
plugin_id: date
header: { }
footer: { }
empty: { }
relationships: { }
arguments:
id:
id: id
table: oc_actor_field_revision
field: id
relationship: none
group_type: group
admin_label: ''
default_action: 'not found'
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: false
validate:
type: none
fail: 'not found'
validate_options: { }
break_phrase: false
not: false
entity_type: oc_actor
entity_field: id
plugin_id: numeric
display_extenders: { }
group_by: true
title: 'Contact Details History'
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- user.permissions
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
path: opencase/oc_actor/%/contact_details_history
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- user.permissions
tags: { }

View File

@ -2,20 +2,18 @@ langcode: en
status: true
dependencies:
config:
- block.block.linkforcreatinganewperson
- search_api.index.person_index
- user.role.authenticated
- system.menu.opencase
module:
- search_api
- opencase_entities
- user
id: person_search
label: 'Person Search'
- views_autosubmit
id: equal_opps_records
label: 'Equal Opps Records'
module: views
description: ''
tag: ''
base_table: search_api_index_person_index
base_field: search_api_id
core: 8.x
base_table: oc_equal_opps
base_field: id
display:
default:
display_plugin: default
@ -24,32 +22,35 @@ display:
position: 0
display_options:
access:
type: role
type: perm
options:
role:
authenticated: authenticated
perm: 'view published equal opps entities'
cache:
type: tag
options: { }
query:
type: views_query
options:
bypass_access: false
skip_access: false
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
type: autosubmit
options:
submit_button: Search
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
autosubmit_hide: true
pager:
type: mini
options:
items_per_page: 20
items_per_page: 10
offset: 0
id: 0
total_pages: null
@ -65,18 +66,18 @@ display:
previous:
next:
style:
type: default
type: table
row:
type: fields
fields:
full_name:
id: full_name
table: search_api_index_person_index
field: full_name
name:
id: name
table: oc_equal_opps
field: name
relationship: none
group_type: group
admin_label: ''
label: ''
label: Name
exclude: false
alter:
alter_text: false
@ -109,7 +110,7 @@ display:
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
@ -131,35 +132,43 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
field_rendering: true
fallback_handler: search_api
fallback_options:
link_to_item: false
use_highlighting: false
multi_type: separator
multi_separator: ', '
entity_type: null
entity_field: null
plugin_id: search_api_field
entity_field: name
plugin_id: field
filters:
search_api_fulltext:
id: search_api_fulltext
table: search_api_index_person_index
field: search_api_fulltext
relationship: none
status:
value: '1'
table: oc_equal_opps
field: status
plugin_id: boolean
entity_type: oc_equal_opps
entity_field: status
id: status
expose:
operator: ''
operator_limit_selection: false
operator_list: { }
group: 1
first_name:
id: first_name
table: oc_actor_field_data
field: first_name
relationship: oc_actor
group_type: group
admin_label: ''
operator: or
operator: '='
value: ''
group: 1
exposed: true
expose:
operator_id: search_api_fulltext_op
label: 'Search for People'
operator_id: first_name_op
label: 'First Name'
description: ''
use_operator: false
operator: search_api_fulltext_op
identifier: search_api_fulltext
operator: first_name_op
operator_limit_selection: false
operator_list: { }
identifier: first_name
required: false
remember: false
multiple: false
@ -167,7 +176,8 @@ display:
authenticated: authenticated
anonymous: '0'
administrator: '0'
standard_user: '0'
gno_standard_user: '0'
placeholder: ''
is_grouped: false
group_info:
label: ''
@ -180,40 +190,83 @@ display:
default_group: All
default_group_multiple: { }
group_items: { }
parse_mode: terms
min_length: null
fields: { }
plugin_id: search_api_fulltext
entity_type: oc_actor
entity_field: first_name
plugin_id: string
last_name:
id: last_name
table: oc_actor_field_data
field: last_name
relationship: oc_actor
group_type: group
admin_label: ''
operator: '='
value: ''
group: 1
exposed: true
expose:
operator_id: last_name_op
label: 'Last Name'
description: ''
use_operator: false
operator: last_name_op
operator_limit_selection: false
operator_list: { }
identifier: last_name
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
anonymous: '0'
administrator: '0'
gno_standard_user: '0'
placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: oc_actor
entity_field: last_name
plugin_id: string
sorts: { }
title: 'Person Search'
title: 'Equal Opps Records'
header: { }
footer: { }
empty:
area_text_custom:
id: area_text_custom
area:
id: area
table: views
field: area_text_custom
field: area
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: false
content: 'No results.'
plugin_id: text_custom
entity_block:
id: entity_block
table: views
field: entity_block
content:
value: 'There is no Equal Opps record by that name. Please check the spelling'
format: basic_html
plugin_id: text
relationships:
oc_actor:
id: oc_actor
table: oc_equal_opps
field: oc_actor
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: true
target: linkforcreatinganewperson
view_mode: default
bypass_access: true
plugin_id: entity
relationships: { }
admin_label: Person
required: true
entity_type: oc_equal_opps
entity_field: oc_actor
plugin_id: standard
arguments: { }
display_extenders: { }
use_ajax: true
@ -224,23 +277,7 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user.roles
tags: { }
block_1:
display_plugin: block
id: block_1
display_title: Block
position: 2
display_options:
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.roles
- user.permissions
tags: { }
page_1:
display_plugin: page
@ -249,8 +286,17 @@ display:
position: 1
display_options:
display_extenders: { }
path: person-search
path: equal-opps-records
exposed_block: true
menu:
type: normal
title: 'Equal Opps Records'
description: ''
expanded: false
parent: opencase.see_all
weight: 10
context: '0'
menu_name: opencase
cache_metadata:
max-age: -1
contexts:
@ -258,5 +304,5 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user.roles
- user.permissions
tags: { }

View File

@ -1,25 +0,0 @@
langcode: en
status: false
dependencies:
module:
- system
- zencrm
theme:
- bartik
id: hatcreator
theme: bartik
region: sidebar_second
weight: -6
provider: null
plugin: hat_creator
settings:
id: hat_creator
label: ''
provider: zencrm
label_display: visible
visibility:
request_path:
id: request_path
pages: '/zencrm/person/*'
negate: false
context_mapping: { }

View File

@ -1,25 +0,0 @@
langcode: en
status: true
dependencies:
module:
- system
- zencrm
theme:
- bartik
id: personpanel
theme: bartik
region: content
weight: 0
provider: null
plugin: person_panel
settings:
id: person_panel
label: 'Person Panel'
provider: zencrm
label_display: '0'
visibility:
request_path:
id: request_path
pages: '/zencrm/person/*'
negate: false
context_mapping: { }

View File

@ -1,30 +0,0 @@
langcode: en
status: true
dependencies:
config:
- views.view.single_case_with_activities
module:
- system
- views
theme:
- bartik
id: views_block__single_case_with_activities_block_1
theme: bartik
region: content
weight: -5
provider: null
plugin: 'views_block:single_case_with_activities-block_1'
settings:
id: 'views_block:single_case_with_activities-block_1'
label: ''
provider: views
label_display: '0'
views_label: ''
items_per_page: none
context_mapping: { }
visibility:
request_path:
id: request_path
pages: '/zencrm/case/*'
negate: false
context_mapping: { }

View File

@ -1,29 +0,0 @@
langcode: en
status: true
dependencies:
config:
- views.view.this_person_s_contact_details
module:
- system
- views
theme:
- bartik
id: views_block__this_person_s_contact_details_block_1
theme: bartik
region: sidebar_second
weight: -7
provider: null
plugin: 'views_block:this_person_s_contact_details-block_1'
settings:
id: 'views_block:this_person_s_contact_details-block_1'
label: ''
provider: views
label_display: visible
views_label: ''
items_per_page: none
visibility:
request_path:
id: request_path
pages: '/zencrm/person/*'
negate: false
context_mapping: { }

View File

@ -0,0 +1,11 @@
langcode: en
status: true
dependencies: { }
id: contact_opencase
label: 'Contact the OpenCase Developers'
recipients:
- naomirosenberguk@gmail.com
reply: ''
weight: 0
message: 'Thank you for your message. The OpenCase team will get back to you ASAP.'
redirect: ''

View File

@ -0,0 +1,39 @@
langcode: en
status: true
dependencies:
config:
- contact.form.contact_opencase
id: contact_message.contact_opencase.default
targetEntityType: contact_message
bundle: contact_opencase
mode: default
content:
copy:
weight: 50
region: content
mail:
weight: -40
region: content
message:
type: string_textarea
weight: 0
settings:
rows: 12
placeholder: ''
region: content
third_party_settings: { }
name:
weight: -50
region: content
preview:
weight: 40
region: content
subject:
type: string_textfield
weight: -10
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }

View File

@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
config:
- contact.form.contact_opencase
id: contact_message.contact_opencase.default
targetEntityType: contact_message
bundle: contact_opencase
mode: default
content:
message:
type: string
weight: 0
label: above
region: content
settings:
link_to_entity: false
third_party_settings: { }
hidden: { }

View File

@ -1,387 +0,0 @@
langcode: en
status: true
dependencies:
config:
- block.block.hatcreator
module:
- zencrm_entities
id: this_person_s_hats
label: Hats
module: views
description: ''
tag: ''
base_table: hat_field_data
base_field: id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: none
options: { }
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: none
options:
offset: 0
style:
type: html_list
options:
grouping: { }
row_class: ''
default_row_class: true
type: ul
wrapper_class: item-list
class: ''
row:
type: fields
fields:
id:
id: id
table: hat_field_data
field: id
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: true
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: number_integer
settings:
thousand_separator: ''
prefix_suffix: true
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: hat
entity_field: id
plugin_id: field
type:
id: type
table: hat_field_data
field: type
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
type: entity_reference_label
settings:
link: false
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: hat
entity_field: type
plugin_id: field
rendered_entity:
id: rendered_entity
table: hat
field: rendered_entity
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
view_mode: default
entity_type: hat
plugin_id: rendered_entity
nothing:
id: nothing
table: views
field: nothing
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: true
text: '<div class=''zencrm_editlink''><a class=''use-ajax'' data-dialog-type=''modal'' href=''/zencrm/hat/{{ raw_arguments.person }}/{{ id }}/edit?destination=/zencrm/person/{{ raw_arguments.person }}''>Edit</a></div>'
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: false
plugin_id: custom
filters: { }
sorts: { }
title: Hats
header: { }
footer:
entity_block:
id: entity_block
table: views
field: entity_block
relationship: none
group_type: group
admin_label: ''
empty: false
tokenize: true
target: hatcreator
view_mode: default
bypass_access: true
plugin_id: entity
empty: { }
relationships: { }
arguments:
person:
id: person
table: hat_field_data
field: person
relationship: none
group_type: group
admin_label: ''
default_action: default
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: raw
default_argument_options:
index: 2
use_alias: false
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: false
validate:
type: none
fail: 'not found'
validate_options: { }
break_phrase: false
not: false
entity_type: hat
entity_field: person
plugin_id: numeric
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
tags:
- 'config:core.entity_view_display.hat.client.default'
- 'config:core.entity_view_display.hat.volunteer.default'
block_1:
display_plugin: block
id: block_1
display_title: Block
position: 1
display_options:
display_extenders: { }
allow:
items_per_page: false
offset: '0'
pager: '0'
hide_fields: '0'
sort_fields: '0'
disable_filters: '0'
configure_sorts: '0'
block_hide_empty: false
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
tags:
- 'config:core.entity_view_display.hat.client.default'
- 'config:core.entity_view_display.hat.volunteer.default'

View File

@ -1,6 +1,6 @@
zencrm_entities.hat_type.*:
opencase.oc_event.*:
type: config_entity
label: 'Hat type config'
label: 'Event config'
mapping:
id:
type: string

View File

@ -1,152 +1,212 @@
/* this part is for the wider theme and will be removed */
a.site-branding__logo img {
max-width: 100px;
}
/* a hack to show different links in sidebar - temporary */
.zencrm_creationlinks.authorised_only {
display: none;
}
.user-logged-in .zencrm_creationlinks.authorised_only {
display: block;
}
.zencrm_creationlinks.anonymous_only {
display: block;
}
.user-logged-in .zencrm_creationlinks.anonymous_only {
/* MOVE THIS INTO MORE!! */
.top_ups_bought.add-activity-link {
display: none;
}
/* Module-specific from here. */
/* paragraphs */
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
width: 100%;
.paragraph .field {
width: auto;
}
button.button--primary.js-form-submit.form-submit.ui-button.ui-corner-all.ui-widget {
margin-left: 73%;
}
button.button.button--danger.ui-button.ui-corner-all.ui-widget {
float: left;
color: red;
}
.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-dialog-buttons {
min-width: 550px;
border: 20px solid rgba(0, 0, 0, 0.51);
}
.tabledrag-toggle-weight-wrapper {
display: none;
}
#content .zencrm_case_details {
display: none; /* don't show case as main content - it's shown in sidebar */
}
div.region.region-primary-menu {
display:none;
}
.field--name-contact-details a {
border-bottom: none;
}
.sidebar .field--type-entity-reference {
margin: 1em 0 0 0;
}
.region-sidebar-second .view-content li, .region-sidebar-second .views-row, .region-sidebar-second .zencrm_inner_sidebar_block {
border-bottom: 10px solid #e6e6d3;
padding-bottom: 20px;
padding-top: 10px;
padding-right: 10px;
padding-left: 10px;
background: #eeeedb;
border: 1px solid lightgrey;
margin-bottom: 10px;
}
.sidebar .region-sidebar-second h2 {
font-size: 1.6em;
text-align: center;
border-bottom: 1px solid grey;
}
.sidebar .views-field.views-field-type, .sidebar .field--name-type, .zencrm_inner_sidebar_block .zencrm_title {
padding-bottom: 12px;
font-size: 1.4em;
text-align: center;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.zencrm_inner_sidebar_block .zencrm_title {
font-size: 1.2em;
padding-bottom: 5px;
}
.sidebar .field__label, .sidebar .field--type-entity-reference .field__label, .form-item label {
font-size: 1em;
font-weight: bold;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.sidebar .views-element-container .field, .sidebar .zencrm_inner_sidebar_block .field {
padding-bottom: 15px;
}
.sidebar .views-element-container .field .field__item, .sidebar .zencrm_inner_sidebar_block .field__item {
font-size: 1.1em;
}
.region-sidebar-second .view-content li, .region-sidebar-second .views-row {
padding-bottom: 20px;
padding-top: 10px;
padding-right: 10px;
padding-left: 10px;
background: #eeeedb;
}
.region-sidebar-second .views-element-container.block, #block-casedetails {
padding-right: 10px;
padding-left: 10px;
}
.zencrm_creationlinks {
padding: 10px 10px 10px 20px;
font-size: 1.2em;
}
.sidebar .zencrm_links {
font-size: 1.2em;
}
.sidebar .zencrm_links p, .sidebar .zencrm_creationlinks p {
margin-bottom: 0.5em;
}
.zencrm_creationlinks p {
margin-bottom: 0.5em;
}
.sidebar .zencrm_creationlinks {
padding: 5px;
font-size: 1.3em;
}
.sidebar .zencrm_editlink {
font-size: 1.2em;
text-align: right;
}
#block-hatcreator {
padding: 0;
.field.field--type-entity-reference-revisions {
border: none;
margin: 0;
padding: 0.4em;
}
.field.field--type-entity-reference-revisions .field__item {
padding: 0;
}
/* end paragraphs */
/* MOVE THIS INTO GNO! */
#block-accreditationcount {
position: absolute;
right: 50%;
/*background-color: #fff;*/
background-image: linear-gradient(to top, #2a419a 0%, #1d84c3 100%);
border-radius: 5px;
}
#block-accreditationcount table {
border: 0px #2a419a;
background-color: #1d84c3;
}
#block-accreditationcount h1 {
color: white;
}
#block-accreditationcount td {
color: black;
}
/* */
body {
font-size: 100% !important;
}
.field.field--type-entity-reference {
margin: inherit;
}
.field {
width: 30%;
display: inline-block;
padding: 0.4em;
}
/* remove this confusing thing from user creation page */
#edit-password-policy-status {
display: none;
}
.form-composite > .fieldset-wrapper > .description, .form-item .description {
font-size: 1em !important;
}
div[data-drupal-selector=edit-user-bulk-form] {
display: none;
}
.layout-container {
max-width: 95% !important;
}
/* Free the people from the tyranny of the useless search button */
#edit-submit-actor-search, #edit-submit-actor-search--2{
display: none;
}
/* Remove the revision message box. Temporary until can place it properly */
#edit-revision-log-message-wrapper{
display: none;
}
/* Same for revision checkbox. */
.js-form-item.form-item.js-form-type-checkbox.form-type-checkbox.js-form-item-new-revision.form-item-new-revision {
display: none;
}
/* Style the search box in header bar. */
#block-exposedformactor-searchpage-1 {
top: -20px;
}
#block-exposedformactor-searchpage-1 #edit-actions {
padding-top: 0;
}
#block-exposedformactor-searchpage-1 .form-text {
width: 200px;
}
/* Make drop-down nav menu opaque */
.block-superfish .menu ul {
background: white;
color: darkgray;
}
.block-superfish .menu ul li {
border-bottom: 1px dotted darkgray;
}
.block-superfish .menu ul li a:hover {
color: black;
}
/* In views, display label at top of field. Ths is because full descriptions are displayed in the activity view so having the label in the middle means it disappears down the page. */
td.views-field {
vertical-align: top;
}
/* Entity displays */
.oc_entity .left {
display: inline-block;
width: 45%;
padding: 1em;
}
.oc_entity .right {
display: inline-block;
width: 45%;
padding: 1em;
float: right;
}
.oc_entity .field {
margin-top: 1em;
}
/* Make entity reference field labels match normal field labels */
.field--type-entity-reference .field__label {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 1em !important;
font-weight: bold !important;
}
/* remove "details" accordion, see https://drupal.stackexchange.com/questions/294312/why-has-this-details-accordion-appeared-in-this-view */
.views-table details {
display: none;
}
form.oc-organisation-relation-form tr:first-child {
display: none;
}
/* trav styling */
.site-branding {
margin-top: -2.20em !important;
}
.follow-ups-due td {
background-color: #FB8A4F;
}
#block-accreditationcount th,
#block-accreditationcount td {
border: none;
}
#block-accreditationcount {
padding: 1em;
}
tr:nth-child(even) {
background-color: #fefefe;
}
tr:nth-child(odd) {
background-color: #eee;
}
.Off {
color:gray;
}
.Off a {
color:gray;
}
.field--type-entity-reference-revisions {
border-radius: 25px;
border: 2px solid #2A419A;
padding: 10px;
border-width: thin;
}
.follow-ups-due table{
background-color: #FB8A4F;
}
.views-field-field-client-substatus {
font-weight: bold;
}
thead {
background-color: #1d84c3;
}

67
docs/install.txt Normal file
View File

@ -0,0 +1,67 @@
composer create-project drupal/recommended-project:8.9.8 drupal
# ADD THIS TO drupal/composer.json IN THE REPOSITORIES SECTION
,{
"type": "vcs",
"url": "https://git.autonomic.zone/autonomic-cooperative/opencase.git"
}
# INSTALL MODULES VIA COMPOSER (this will add them to composer.json, which is better than using a premade one, because this way the versions will all sort themselves out)
composer require drupal/admin_toolbar drupal/security_review drupal/smtp drupal/opencase drupal/superfish
# CREATE DIRECTORIES AND SET UP FILE PERMISSIONS
# start in drupal directory
mkdir -p config/sync
mkdir private
# if web server user =/= deployment user:
# start in drupal directory
sudo chgrp www-data config/sync
cd web
cp sites/default/default.settings.php sites/default/settings.php
sudo chgrp www-data . -R
mkdir sites/default/files
sudo chmod g+w sites/default/files -R
chmod g+w sites/default/settings.php
sudo find -type d -exec chmod g+s {} \;
sudo chmod g-w sites/default/
sudo chmod g-w sites
sudo chmod g-w sites ./sites/example.settings.local.php ./sites/development.services.yml ./sites/example.sites.php ./sites/default/default.services.yml ./sites/default/default.settings.php ./autoload.php
sudo chmod g-w -R modules/
sudo chmod g-w -R core
sudo chmod g-w profiles index.php update.php
sudo chmod g-w themes -R
sudo chmod g-w web.config robots.txt
cd ../
sudo chmod g-w -R web/modules
sudo chgrp www-data private
sudo chmod g+w,o-r,o-x private
# INSTALL THE SITE
- Create a database
- Go to the url and run the installer
# make settings file unwriteable now that it has been generated
sudo chmod a-w sites/default/settings.php
# ENABLE all the above modules
drush en admin_toolbar security_review smtp opencase -y
# TODO set $trusted_host_patterns (in settings.php)
# TODO private files (in settings.php)
# TODO Set all the HTML roles to admin only - /admin/config/content/formats
# TODO run security review (make eveything untrusted except CRM Admin and Admin) - /admin/config/security-review
# TODO homepage -> /opencase/whatever-the-chosen-homepage, 403 - /user/login - /admin/config/system/site-information
# TODO disable blocks: tools, main navigation, footer menu - /admin/structure/block
# TODO logo & colours - admin/appearance/settings/bartik
# TODO disallow registering an account & turn off personal contact forms - /admin/config/people/accounts
# TODO add linked actor field to form display and display display - top of both
# TODO change which contact form is the default - /admin/structure/contact
# TODO change "short" date formate to d/m/Y - /admin/config/regional/date-time

View File

@ -1,38 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.activity.case_note.field_file
- field.field.activity.case_note.field_notes
- zencrm_entities.activity_type.case_note
module:
- file
id: activity.case_note.default
targetEntityType: activity
bundle: case_note
mode: default
content:
field_file:
weight: 4
settings:
progress_indicator: throbber
third_party_settings: { }
type: file_generic
region: content
field_notes:
weight: 3
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: string_textarea
region: content
name:
type: string_textfield
weight: -4
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }

View File

@ -1,32 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.activity.self_assessment.field_how_is_your_housing_situat
- field.field.activity.self_assessment.field_how_is_your_mental_health_
- field.field.activity.self_assessment.field_how_is_your_physical_healt
- zencrm_entities.activity_type.self_assessment
id: activity.self_assessment.default
targetEntityType: activity
bundle: self_assessment
mode: default
content:
field_how_is_your_housing_situat:
weight: 5
settings: { }
third_party_settings: { }
type: options_buttons
region: content
field_how_is_your_mental_health_:
weight: 4
settings: { }
third_party_settings: { }
type: options_buttons
region: content
field_how_is_your_physical_healt:
weight: 3
settings: { }
third_party_settings: { }
type: options_buttons
region: content
hidden: { }

View File

@ -1,29 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.case_entity.asylum.field_asyl
- field.field.case_entity.asylum.field_home_offi
- zencrm_entities.case_entity_type.asylum
id: case_entity.asylum.default
targetEntityType: case_entity
bundle: asylum
mode: default
content:
field_asyl:
weight: 6
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
field_home_offi:
weight: 7
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
hidden: { }

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
config:
- zencrm_entities.case_entity_type.housing
id: case_entity.housing.default
targetEntityType: case_entity
bundle: housing
mode: default
content:
user_id:
type: entity_reference_autocomplete
weight: 5
settings:
match_operator: CONTAINS
size: 60
placeholder: ''
region: content
third_party_settings: { }
hidden: { }

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
config:
- zencrm_entities.case_entity_type.volunteer_recruitment
id: case_entity.volunteer_recruitment.default
targetEntityType: case_entity
bundle: volunteer_recruitment
mode: default
content:
user_id:
type: entity_reference_autocomplete
weight: 5
settings:
match_operator: CONTAINS
size: 60
placeholder: ''
region: content
third_party_settings: { }
hidden: { }

View File

@ -1,29 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.hat.client.field_country
- field.field.hat.client.field_language
- zencrm_entities.hat_type.client
id: hat.client.default
targetEntityType: hat
bundle: client
mode: default
content:
field_country:
weight: 3
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
field_language:
weight: 4
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
hidden: { }

View File

@ -1,38 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.hat.volunteer.field_availability
- field.field.hat.volunteer.field_date_started
- field.field.hat.volunteer.field_team
- zencrm_entities.hat_type.volunteer
module:
- datetime
id: hat.volunteer.default
targetEntityType: hat
bundle: volunteer
mode: default
content:
field_availability:
weight: 6
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: string_textarea
region: content
field_date_started:
weight: 5
settings: { }
third_party_settings: { }
type: datetime_default
region: content
field_team:
weight: 4
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
hidden: { }

View File

@ -1,38 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.activity.case_note.field_file
- field.field.activity.case_note.field_notes
- zencrm_entities.activity_type.case_note
module:
- file
id: activity.case_note.default
targetEntityType: activity
bundle: case_note
mode: default
content:
field_file:
weight: -2
label: above
settings:
use_description_as_link_text: true
third_party_settings: { }
type: file_default
region: content
field_notes:
weight: -3
label: above
settings: { }
third_party_settings: { }
type: basic_string
region: content
name:
label: above
type: string
weight: -4
region: content
settings:
link_to_entity: false
third_party_settings: { }
hidden: { }

View File

@ -1,37 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.activity.self_assessment.field_how_is_your_housing_situat
- field.field.activity.self_assessment.field_how_is_your_mental_health_
- field.field.activity.self_assessment.field_how_is_your_physical_healt
- zencrm_entities.activity_type.self_assessment
module:
- options
id: activity.self_assessment.default
targetEntityType: activity
bundle: self_assessment
mode: default
content:
field_how_is_your_housing_situat:
weight: -1
label: above
settings: { }
third_party_settings: { }
type: list_default
region: content
field_how_is_your_mental_health_:
weight: -2
label: above
settings: { }
third_party_settings: { }
type: list_default
region: content
field_how_is_your_physical_healt:
weight: -3
label: above
settings: { }
third_party_settings: { }
type: list_default
region: content
hidden: { }

View File

@ -1,29 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.case_entity.asylum.field_asyl
- field.field.case_entity.asylum.field_home_offi
- zencrm_entities.case_entity_type.asylum
id: case_entity.asylum.default
targetEntityType: case_entity
bundle: asylum
mode: default
content:
field_asyl:
weight: 1
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
field_home_offi:
weight: 2
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
hidden: { }

View File

@ -1,26 +0,0 @@
langcode: en
status: true
dependencies:
config:
- zencrm_entities.case_entity_type.housing
id: case_entity.housing.default
targetEntityType: case_entity
bundle: housing
mode: default
content:
name:
label: above
type: string
weight: -4
region: content
settings:
link_to_entity: false
third_party_settings: { }
user_id:
label: hidden
type: author
weight: 0
region: content
settings: { }
third_party_settings: { }
hidden: { }

View File

@ -1,26 +0,0 @@
langcode: en
status: true
dependencies:
config:
- zencrm_entities.case_entity_type.volunteer_recruitment
id: case_entity.volunteer_recruitment.default
targetEntityType: case_entity
bundle: volunteer_recruitment
mode: default
content:
name:
label: above
type: string
weight: -4
region: content
settings:
link_to_entity: false
third_party_settings: { }
user_id:
label: hidden
type: author
weight: 0
region: content
settings: { }
third_party_settings: { }
hidden: { }

View File

@ -1,29 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.hat.client.field_country
- field.field.hat.client.field_language
- zencrm_entities.hat_type.client
id: hat.client.default
targetEntityType: hat
bundle: client
mode: default
content:
field_country:
weight: 1
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
field_language:
weight: 2
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
hidden: { }

View File

@ -1,40 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.field.hat.volunteer.field_availability
- field.field.hat.volunteer.field_date_started
- field.field.hat.volunteer.field_team
- zencrm_entities.hat_type.volunteer
module:
- datetime
id: hat.volunteer.default
targetEntityType: hat
bundle: volunteer
mode: default
content:
field_availability:
weight: 104
label: above
settings: { }
third_party_settings: { }
type: basic_string
region: content
field_date_started:
weight: 103
label: above
settings:
format_type: medium
timezone_override: ''
third_party_settings: { }
type: datetime_default
region: content
field_team:
weight: 102
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
hidden: { }

View File

@ -1,26 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.activity.field_file
- zencrm_entities.activity_type.case_note
module:
- file
id: activity.case_note.field_file
field_name: field_file
entity_type: activity
bundle: case_note
label: Files
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'txt jpg rtf doc png pdf'
max_filesize: ''
description_field: false
handler: 'default:file'
handler_settings: { }
field_type: file

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.activity.field_notes
- zencrm_entities.activity_type.case_note
id: activity.case_note.field_notes
field_name: field_notes
entity_type: activity
bundle: case_note
label: Notes
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string_long

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.activity.field_how_is_your_housing_situat
- zencrm_entities.activity_type.self_assessment
module:
- options
id: activity.self_assessment.field_how_is_your_housing_situat
field_name: field_how_is_your_housing_situat
entity_type: activity
bundle: self_assessment
label: 'How is your housing situation?'
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: list_string

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.activity.field_how_is_your_mental_health_
- zencrm_entities.activity_type.self_assessment
module:
- options
id: activity.self_assessment.field_how_is_your_mental_health_
field_name: field_how_is_your_mental_health_
entity_type: activity
bundle: self_assessment
label: 'How is your mental health?'
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: list_string

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.activity.field_how_is_your_physical_healt
- zencrm_entities.activity_type.self_assessment
module:
- options
id: activity.self_assessment.field_how_is_your_physical_healt
field_name: field_how_is_your_physical_healt
entity_type: activity
bundle: self_assessment
label: 'How is your physical health?'
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: list_string

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.case_entity.field_asyl
- zencrm_entities.case_entity_type.asylum
id: case_entity.asylum.field_asyl
field_name: field_asyl
entity_type: case_entity
bundle: asylum
label: 'Asylum status when taken on'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.case_entity.field_home_offi
- zencrm_entities.case_entity_type.asylum
id: case_entity.asylum.field_home_offi
field_name: field_home_offi
entity_type: case_entity
bundle: asylum
label: 'Home Office Number'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.hat.field_country
- zencrm_entities.hat_type.client
id: hat.client.field_country
field_name: field_country
entity_type: hat
bundle: client
label: 'Country of Origin'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.hat.field_language
- zencrm_entities.hat_type.client
id: hat.client.field_language
field_name: field_language
entity_type: hat
bundle: client
label: Language
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.hat.field_availability
- zencrm_entities.hat_type.volunteer
id: hat.volunteer.field_availability
field_name: field_availability
entity_type: hat
bundle: volunteer
label: Availability
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string_long

View File

@ -1,23 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.hat.field_date_started
- zencrm_entities.hat_type.volunteer
module:
- datetime
id: hat.volunteer.field_date_started
field_name: field_date_started
entity_type: hat
bundle: volunteer
label: 'Date Started'
description: ''
required: false
translatable: false
default_value:
-
default_date_type: now
default_date: now
default_value_callback: ''
settings: { }
field_type: datetime

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
config:
- field.storage.hat.field_team
- zencrm_entities.hat_type.volunteer
id: hat.volunteer.field_team
field_name: field_team
entity_type: hat
bundle: volunteer
label: Team
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View File

@ -1,22 +0,0 @@
langcode: en
status: true
dependencies:
module:
- file
- zencrm_entities
id: activity.field_file
field_name: field_file
entity_type: activity
type: file
settings:
display_field: false
display_default: false
uri_scheme: private
target_type: file
module: file
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,35 +0,0 @@
langcode: en
status: true
dependencies:
module:
- options
- zencrm_entities
id: activity.field_how_is_your_housing_situat
field_name: field_how_is_your_housing_situat
entity_type: activity
type: list_string
settings:
allowed_values:
-
value: Excellent
label: Excellent
-
value: Good
label: Good
-
value: OK
label: OK
-
value: Bad
label: Bad
-
value: Terrible
label: Terrible
allowed_values_function: ''
module: options
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,35 +0,0 @@
langcode: en
status: true
dependencies:
module:
- options
- zencrm_entities
id: activity.field_how_is_your_mental_health_
field_name: field_how_is_your_mental_health_
entity_type: activity
type: list_string
settings:
allowed_values:
-
value: Excellent
label: Excellent
-
value: Good
label: Good
-
value: OK
label: OK
-
value: Bad
label: Bad
-
value: Terrible
label: Terrible
allowed_values_function: ''
module: options
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,35 +0,0 @@
langcode: en
status: true
dependencies:
module:
- options
- zencrm_entities
id: activity.field_how_is_your_physical_healt
field_name: field_how_is_your_physical_healt
entity_type: activity
type: list_string
settings:
allowed_values:
-
value: Excellent
label: Excellent
-
value: Good
label: Good
-
value: OK
label: OK
-
value: Bad
label: Bad
-
value: Terrible
label: Terrible
allowed_values_function: ''
module: options
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
module:
- zencrm_entities
id: case_entity.field_asyl
field_name: field_asyl
entity_type: case_entity
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
module:
- zencrm_entities
id: case_entity.field_home_offi
field_name: field_home_offi
entity_type: case_entity
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,18 +0,0 @@
langcode: en
status: true
dependencies:
module:
- zencrm_entities
id: hat.field_availability
field_name: field_availability
entity_type: hat
type: string_long
settings:
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
module:
- zencrm_entities
id: hat.field_country
field_name: field_country
entity_type: hat
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,19 +0,0 @@
langcode: en
status: true
dependencies:
module:
- datetime
- zencrm_entities
id: hat.field_date_started
field_name: field_date_started
entity_type: hat
type: datetime
settings:
datetime_type: date
module: datetime
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
module:
- zencrm_entities
id: hat.field_language
field_name: field_language
entity_type: hat
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,20 +0,0 @@
langcode: en
status: true
dependencies:
module:
- zencrm_entities
id: hat.field_team
field_name: field_team
entity_type: hat
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@ -1,5 +0,0 @@
langcode: en
status: true
dependencies: { }
id: case_note
label: 'Case Note'

View File

@ -1,5 +0,0 @@
langcode: en
status: true
dependencies: { }
id: self_assessment
label: Self-assessment

View File

@ -1,5 +0,0 @@
langcode: en
status: true
dependencies: { }
id: asylum
label: Asylum

View File

@ -1,5 +0,0 @@
langcode: en
status: true
dependencies: { }
id: housing
label: Housing

View File

@ -1,5 +0,0 @@
langcode: en
status: true
dependencies: { }
id: volunteer_recruitment
label: 'Volunteer recruitment'

View File

@ -1,5 +0,0 @@
langcode: en
status: true
dependencies: { }
id: client
label: Client

View File

@ -1,5 +0,0 @@
langcode: en
status: true
dependencies: { }
id: volunteer
label: Volunteer

View File

@ -1,6 +0,0 @@
bundle: opencase
excluded:
- block.block.views_block__single_case_with_activities_block_1
- block.block.views_block__this_person_s_contact_details_block_1
- block.block.views_block__this_person_s_hats_block_1
required: true

View File

@ -1,11 +0,0 @@
name: 'Default Subtypes'
type: module
core: 8.x
dependencies:
- block
- datetime
- field
- system
- views
- zencrm_entities
package: 'OpenCase'

View File

@ -1,7 +0,0 @@
langcode: en
status: true
dependencies: { }
id: anonymous
label: 'Anonymous user'
weight: 0
is_admin: false

View File

@ -1,6 +0,0 @@
bundle: opencase
excluded:
- block.block.views_block__single_case_with_activities_block_1
- block.block.views_block__this_person_s_contact_details_block_1
- block.block.views_block__this_person_s_hats_block_1
required: true

View File

@ -1,9 +0,0 @@
name: default_user_config
type: module
core: 8.x
dependencies:
- block
- system
- user
- views
package: 'OpenCase'

View File

@ -1,4 +1,3 @@
(function ($, Drupal) {
$(".field--name-contact-details a").contents().unwrap();
$('#edit-search-api-fulltext').attr('autocomplete', 'off');
})(jQuery, Drupal);

View File

@ -1,6 +1,6 @@
zencrm_entities.case_entity_type.*:
opencase_cases.oc_case_fee_type.*:
type: config_entity
label: 'Case entity type config'
label: 'Case Fee type config'
mapping:
id:
type: string

View File

@ -0,0 +1,12 @@
opencase_cases.oc_case_provision_type.*:
type: config_entity
label: 'Case Provision type config'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
uuid:
type: string

View File

@ -0,0 +1,15 @@
opencase_cases.oc_case_type.*:
type: config_entity
label: 'Case type config'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
allowedActivityTypes:
type: sequence
label: 'Allowed Activity Types'
uuid:
type: string

View File

@ -0,0 +1,37 @@
<?php
/**
* @file
* Contains oc_case.page.inc.
*
* Page callback for Case entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Case templates.
*
* Default template: oc_case.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_oc_case(array &$variables) {
// Separate the fields into two sections to be displayed in two columns.
// Remove the name (title) field as this is displayed anyway.
$variables['id'] = $variables['elements']['#oc_case']->get('id')[0]->get('value')->getValue();
$variables['base_fields'] = array();
$variables['other_fields'] = array();
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
if (in_array($key, ['created', 'changed', 'files', 'actors_involved', 'status', 'user_id'])) {
$variables['base_fields'][$key] = $variables['elements'][$key];
} else {
$variables['other_fields'][$key] = $variables['elements'][$key];
unset($variables['other_fields']['name']);
}
}
}

View File

@ -2,26 +2,26 @@
/**
* @file
* Contains activity.page.inc.
* Contains oc_case_fee.page.inc.
*
* Page callback for Activity entities.
* Page callback for Case Fee entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Activity templates.
* Prepares variables for Case Fee templates.
*
* Default template: activity.html.twig.
* Default template: oc_case_fee.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_activity(array &$variables) {
// Fetch Activity Entity Object.
$activity = $variables['elements']['#activity'];
function template_preprocess_oc_case_fee(array &$variables) {
// Fetch OCCaseFee Entity Object.
$oc_case_fee = $variables['elements']['#oc_case_fee'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {

View File

@ -2,26 +2,26 @@
/**
* @file
* Contains contact_details.page.inc.
* Contains oc_case_provision.page.inc.
*
* Page callback for Contact details entities.
* Page callback for Case Provision entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Contact details templates.
* Prepares variables for Case Provision templates.
*
* Default template: contact_details.html.twig.
* Default template: oc_case_provision.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_contact_details(array &$variables) {
// Fetch ContactDetails Entity Object.
$contact_details = $variables['elements']['#contact_details'];
function template_preprocess_oc_case_provision(array &$variables) {
// Fetch OCCaseProvision Entity Object.
$oc_case_provision = $variables['elements']['#oc_case_provision'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {

View File

@ -0,0 +1,11 @@
name: 'Opencase Cases'
type: module
description: 'Provides case entities and a required field on activities linking them to a case.'
core_version_requirement: 9.x
package: OpenCase
dependencies:
0: opencase_entities
1: datetime
4: options
5: paragraphs
6: user

View File

@ -0,0 +1,102 @@
<?php
use \Drupal\Core\Field\BaseFieldDefinition;
function opencase_cases_update_90002() {
$field_storage_definition = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Target'))
->setRevisionable(TRUE)
->setSetting('target_type', 'oc_actor')
->setSetting('handler', 'default')
->setDefaultValueCallback('\Drupal\opencase_cases\Entity\OCCase::defaultTarget')
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('oc_target', 'oc_case', 'opencase_cases', $field_storage_definition);
}
function opencase_cases_update_8025() {
//check if the table exists first. If not, then create the entity.
if(!db_table_exists('oc_case_provision')) {
\Drupal::entityTypeManager()->clearCachedDefinitions();
\Drupal::entityDefinitionUpdateManager()
->installEntityType(\Drupal::entityTypeManager()->getDefinition('oc_case_provision'));
}
}
function opencase_cases_update_8026() {
$storage_definition = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Role'))
->setSetting('target_type', 'taxonomy_term')
->setSetting('handler_settings', ['target_bundles' => ['oc_case_provider_role' => 'oc_case_provider_role']])
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setCardinality(1)
->setDisplayConfigurable("view", true)
->setDisplayConfigurable("form", true)
->setRequired(FALSE);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('oc_case_provider_role', 'oc_case_provision', 'oc_case_provision', $storage_definition);
}
function opencase_cases_update_8027() {
//check if the table exists first. If not, then create the entity.
if(!db_table_exists('oc_case_fee')) {
\Drupal::entityTypeManager()->clearCachedDefinitions();
\Drupal::entityDefinitionUpdateManager()
->installEntityType(\Drupal::entityTypeManager()->getDefinition('oc_case_fee'));
}
}
function opencase_cases_update_8028() {
$storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('decimal')
->setLabel(t('Amount'))
->setRevisionable(TRUE)
->setSettings([
'prefix' => '£',
])
->SetDisplayConfigurable("form", true)
->SetDisplayConfigurable("view", true);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('amount', 'oc_case_fee', 'oc_case_fee', $storage_definition);
$storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Fee Category'))
->setSetting('target_type', 'taxonomy_term')
->setSetting('handler_settings', ['target_bundles' => ['oc_fee_category' => 'oc_fee_category']])
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setCardinality(1)
->setDisplayConfigurable("view", true)
->setDisplayConfigurable("form", true)
->setRequired(FALSE);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('oc_fee_category', 'oc_case_fee', 'oc_case_fee', $storage_definition);
}
function opencase_cases_update_8029() {
$storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('string_long')
->setRevisionable(TRUE)
->setLabel(t('Notes'))
->setSettings(array(
'default_value' => '',
'max_length' => 255,
'text_processing' => 0,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('notes', 'oc_case', 'oc_case', $storage_definition);
}
function opencase_cases_update_8030() {
$storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('decimal')
->setLabel(t('Total Fee'))
->setRevisionable(TRUE)
->setSettings([
'prefix' => '£',
])
->SetDisplayConfigurable("view", true);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('total_fee', 'oc_case', 'oc_case', $storage_definition);
}

View File

@ -0,0 +1,32 @@
entity.oc_case.add_form:
route_name: entity.oc_case.add_page
title: 'Add Case'
appears_on:
- entity.oc_case.collection
entity.oc_case_type.add_form:
route_name: entity.oc_case_type.add_form
title: 'Add Case type'
appears_on:
- entity.oc_case_type.collection
entity.oc_case_provision.add_form:
route_name: entity.oc_case_provision.add_page
title: 'Add Case Provision'
appears_on:
- entity.oc_case_provision.collection
entity.oc_case_provision_type.add_form:
route_name: entity.oc_case_provision_type.add_form
title: 'Add Case Provision type'
appears_on:
- entity.oc_case_provision_type.collection
entity.oc_case_fee.add_form:
route_name: entity.oc_case_fee.add_page
title: 'Add Case Fee'
appears_on:
- entity.oc_case_fee.collection
entity.oc_case_fee_type.add_form:
route_name: entity.oc_case_fee_type.add_form
title: 'Add Case Fee type'
appears_on:
- entity.oc_case_fee_type.collection

View File

@ -0,0 +1,59 @@
opencase_cases.manage_case_types:
title: 'Manage case types'
description: 'Configure types of cases and their fields'
menu_name: opencase
parent: opencase.opencase_admin_menu
url: internal:/admin/opencase/oc_case_type
weight: 2
# Case menu items definition
entity.oc_case.collection:
title: 'Case list'
route_name: entity.oc_case.collection
description: 'List Case entities'
parent: system.admin_structure
weight: 100
# Case type menu items definition
entity.oc_case_type.collection:
title: 'Case type'
route_name: entity.oc_case_type.collection
description: 'List Case type (bundles)'
parent: system.admin_structure
weight: 99
# Case Provision menu items definition
entity.oc_case_provision.collection:
title: 'Case Provision list'
route_name: entity.oc_case_provision.collection
description: 'List Case Provision entities'
parent: system.admin_structure
weight: 100
# Case Provision type menu items definition
entity.oc_case_provision_type.collection:
title: 'Case Provision type'
route_name: entity.oc_case_provision_type.collection
description: 'List Case Provision type (bundles)'
parent: system.admin_structure
weight: 99
# Case Fee menu items definition
entity.oc_case_fee.collection:
title: 'Case Fee list'
route_name: entity.oc_case_fee.collection
description: 'List Case Fee entities'
parent: system.admin_structure
weight: 100
# Case Fee type menu items definition
entity.oc_case_fee_type.collection:
title: 'Case Fee type'
route_name: entity.oc_case_fee_type.collection
description: 'List Case Fee type (bundles)'
parent: system.admin_structure
weight: 99

View File

@ -0,0 +1,67 @@
# Case routing definition
entity.oc_case.canonical:
route_name: entity.oc_case.canonical
base_route: entity.oc_case.canonical
title: 'View'
entity.oc_case.edit_form:
route_name: entity.oc_case.edit_form
base_route: entity.oc_case.canonical
title: 'Edit'
entity.oc_case.version_history:
route_name: entity.oc_case.version_history
base_route: entity.oc_case.canonical
title: 'Revisions'
entity.oc_case.delete_form:
route_name: entity.oc_case.delete_form
base_route: entity.oc_case.canonical
title: Delete
weight: 10
# Case Provision routing definition
entity.oc_case_provision.canonical:
route_name: entity.oc_case_provision.canonical
base_route: entity.oc_case_provision.canonical
title: 'View'
entity.oc_case_provision.edit_form:
route_name: entity.oc_case_provision.edit_form
base_route: entity.oc_case_provision.canonical
title: 'Edit'
entity.oc_case_provision.version_history:
route_name: entity.oc_case_provision.version_history
base_route: entity.oc_case_provision.canonical
title: 'Revisions'
entity.oc_case_provision.delete_form:
route_name: entity.oc_case_provision.delete_form
base_route: entity.oc_case_provision.canonical
title: Delete
weight: 10
# Case Fee routing definition
entity.oc_case_fee.canonical:
route_name: entity.oc_case_fee.canonical
base_route: entity.oc_case_fee.canonical
title: 'View'
entity.oc_case_fee.edit_form:
route_name: entity.oc_case_fee.edit_form
base_route: entity.oc_case_fee.canonical
title: 'Edit'
entity.oc_case_fee.version_history:
route_name: entity.oc_case_fee.version_history
base_route: entity.oc_case_fee.canonical
title: 'Revisions'
entity.oc_case_fee.delete_form:
route_name: entity.oc_case_fee.delete_form
base_route: entity.oc_case_fee.canonical
title: Delete
weight: 10

View File

@ -0,0 +1,244 @@
<?php
declare(strict_types = 1);
/**
* @file
* Contains opencase_cases.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
use PHPUnit\Framework\Constraint\IsEmpty;
use function PHPUnit\Framework\isEmpty;
/**
* Implements hook_help().
*/
function opencase_cases_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the opencase_cases module.
case 'help.page.opencase_cases':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Provides case entities and a required field on activities linking them to a case, plus case fee and case provision entities.') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function opencase_cases_theme() {
return [
'opencase_cases' => [
'render element' => 'children',
],
'oc_case' => [
'render element' => 'elements',
'file' => 'oc_case.page.inc',
'template' => 'oc_case',
],
'oc_case_content_add_list' => [
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'oc_case.page.inc',
],
'oc_case_provision' => [
'render element' => 'elements',
'file' => 'oc_case_provision.page.inc',
'template' => 'oc_case_provision',
],
'oc_case_provision_content_add_list' => [
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'oc_case_provision.page.inc',
],
'oc_case_fee' => [
'render element' => 'elements',
'file' => 'oc_case_fee.page.inc',
'template' => 'oc_case_fee',
],
'oc_case_fee_content_add_list' => [
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'oc_case_fee.page.inc',
],
];
}
/**
* @return Drupal\opencase_cases\entity\OCCaseFee[]
*/
function opencase_cases_get_case_fees(Drupal\opencase_cases\entity\OCCase $case): array {
$query = \Drupal::entityQuery('oc_case_fee')
->condition('oc_case.target_id', $case->id());
$case_fee_ids = $query->execute();
$case_fees = [];
foreach($case_fee_ids as $id) {
$case_fees[] = Drupal\opencase_cases\entity\OCCaseFee::load($id);
}
return $case_fees;
}
/**
* @return Drupal\opencase_cases\entity\OCActivity[]
*/
function opencase_cases_get_activities(Drupal\opencase_cases\entity\OCCase $case): array {
$query = \Drupal::entityQuery('oc_activity')
->condition('oc_case.target_id', $case->id());
$activity_ids = $query->execute();
$activities = [];
foreach($activity_ids as $id) {
$activities[] = Drupal\opencase_entities\Entity\OCActivity::load($id);
}
return $activities;
}
function opencase_cases_get_amount(Drupal\opencase_cases\entity\OCCaseFee $case_fee): string {
if (!isEmpty($case_fee->amount)) return $case_fee->amount->first()->value;
else return '0';
}
function opencase_cases_get_case(Drupal\opencase_cases\entity\OCCaseFee $case_fee): Drupal\opencase_cases\entity\OCCase {
return $case_fee->oc_case->referencedEntities()[0];
}
function opencase_cases_update_total_fee_for_case_belonging_to_case_fee(Drupal\opencase_cases\entity\OCCaseFee $case_fee): void {
$total = 0;
$case = opencase_cases_get_case($case_fee);
$case_fees = opencase_cases_get_case_fees($case);
foreach($case_fees as $case_fee) {
$total += opencase_cases_get_amount($case_fee);
}
$case->set('total_fee', $total);
$case->save();
}
function opencase_cases_oc_case_fee_update(Drupal\opencase_cases\entity\OCCaseFee $case_fee): void {
opencase_cases_update_total_fee_for_case_belonging_to_case_fee($case_fee);
}
function opencase_cases_oc_case_fee_insert(Drupal\opencase_cases\entity\OCCaseFee $case_fee): void {
opencase_cases_update_total_fee_for_case_belonging_to_case_fee($case_fee);
}
function opencase_cases_oc_case_fee_delete(Drupal\opencase_cases\entity\OCCaseFee $case_fee): void {
opencase_cases_update_total_fee_for_case_belonging_to_case_fee($case_fee);
}
function opencase_cases_entity_base_field_info($entity_type) {
$fields = array();
// Add Case field to Activity
if ($entity_type->id() === 'oc_activity') {
$fields['oc_case'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Case'))
->setDescription(t('The case this activity belongs to.'))
->setSetting('target_type', 'oc_case')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setCardinality(1)
->setDefaultValueCallback('opencase_cases_default_case_id')
->setDisplayOptions('view', [
'type' => 'string',
'weight' => -3,
])
->setRequired(TRUE);
}
return $fields;
}
// When deleting a case, delete the activities associated with it
function opencase_cases_oc_case_delete(Drupal\opencase_cases\Entity\OCCase $case): void {
$activities = opencase_cases_get_activities($case);
foreach ($activities as $activity) {
$activity->delete();
}
}
/**
* When creating an activity, it sets the case id from the URL.
*/
function opencase_cases_default_case_id() {
return array(\Drupal::request()->query->get('case_id'));
}
/**
* Implementation of hook_form_alter()
* Changes what page is redirected to after deleting things
*/
function opencase_cases_form_alter(&$form, &$form_state, $form_id) {
if (preg_match('/oc_actor_.*_delete_form/', $form_id) or (preg_match('/oc_case_.*_delete_form/', $form_id)) or (preg_match('/oc_organisation_.*_delete_form/', $form_id))) {
$form['actions']['submit']['#submit'][] = '_opencase_cases_redirect_to_home';
$form['actions']['cancel']['#url'] = $form_state->getFormObject()->getEntity()->toUrl();
}
if (preg_match('/oc_activity_.*_delete_form/', $form_id)) {
$form['actions']['submit']['#submit'][] = '_opencase_cases_delete_activity_redirect';
$form['actions']['cancel']['#url'] = $form_state->getFormObject()->getEntity()->toUrl();
}
}
function _opencase_cases_redirect_to_home($form, &$form_state) {
$form_state->setRedirect('<front>');
}
// Upon deletion of an activity, go to the related case if there is one, otherwise to its target.
function _opencase_cases_delete_activity_redirect($form, &$form_state) {
if (!IsEmpty($form_state->getFormObject()->getEntity()->oc_case)) {
$case_id = $form_state->getFormObject()->getEntity()->oc_case->target_id;
$form_state->setRedirect('entity.oc_case.canonical', ['oc_case' => $case_id]);
} else {
$target_actor_id = $form_state->getFormObject()->getEntity()->oc_target->target_id;
$form_state->setRedirect('entity.oc_actor.canonical', ['oc_actor' => $target_actor_id]);
}
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
function opencase_cases_theme_suggestions_oc_case(array $variables) {
$suggestions = [];
$entity = $variables['elements']['#oc_case'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'oc_case__' . $sanitized_view_mode;
$suggestions[] = 'oc_case__' . $entity->bundle();
$suggestions[] = 'oc_case__' . $entity->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'oc_case__' . $entity->id();
$suggestions[] = 'oc_case__' . $entity->id() . '__' . $sanitized_view_mode;
return $suggestions;
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
function opencase_cases_theme_suggestions_oc_case_provision(array $variables) {
$suggestions = [];
$entity = $variables['elements']['#oc_case_provision'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'oc_case_provision__' . $sanitized_view_mode;
$suggestions[] = 'oc_case_provision__' . $entity->bundle();
$suggestions[] = 'oc_case_provision__' . $entity->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'oc_case_provision__' . $entity->id();
$suggestions[] = 'oc_case_provision__' . $entity->id() . '__' . $sanitized_view_mode;
return $suggestions;
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
function opencase_cases_theme_suggestions_oc_case_fee(array $variables) {
$suggestions = [];
$entity = $variables['elements']['#oc_case_fee'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'oc_case_fee__' . $sanitized_view_mode;
$suggestions[] = 'oc_case_fee__' . $entity->bundle();
$suggestions[] = 'oc_case_fee__' . $entity->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'oc_case_fee__' . $entity->id();
$suggestions[] = 'oc_case_fee__' . $entity->id() . '__' . $sanitized_view_mode;
return $suggestions;
}

View File

@ -0,0 +1,61 @@
add case provision entities:
title: 'Create new Case Provision entities'
administer case provision entities:
title: 'Administer Case Provision entities'
description: 'Allow to access the administration form to configure Case Provision entities.'
restrict access: true
delete case provision entities:
title: 'Delete Case Provision entities'
edit case provision entities:
title: 'Edit Case Provision entities'
view published case provision entities:
title: 'View published Case Provision entities'
view unpublished case provision entities:
title: 'View unpublished Case Provision entities'
view all case provision revisions:
title: 'View all Case Provision revisions'
revert all case provision revisions:
title: 'Revert all Case Provision revisions'
description: 'Role requires permission <em>view Case Provision revisions</em> and <em>edit rights</em> for case provision entities in question or <em>administer case provision entities</em>.'
delete all case provision revisions:
title: 'Delete all revisions'
description: 'Role requires permission to <em>view Case Provision revisions</em> and <em>delete rights</em> for case provision entities in question or <em>administer case provision entities</em>.'
add case fee entities:
title: 'Create new Case Fee entities'
administer case fee entities:
title: 'Administer Case Fee entities'
description: 'Allow to access the administration form to configure Case Fee entities.'
restrict access: true
delete case fee entities:
title: 'Delete Case Fee entities'
edit case fee entities:
title: 'Edit Case Fee entities'
view published case fee entities:
title: 'View published Case Fee entities'
view unpublished case fee entities:
title: 'View unpublished Case Fee entities'
view all case fee revisions:
title: 'View all Case Fee revisions'
revert all case fee revisions:
title: 'Revert all Case Fee revisions'
description: 'Role requires permission <em>view Case Fee revisions</em> and <em>edit rights</em> for case fee entities in question or <em>administer case fee entities</em>.'
delete all case fee revisions:
title: 'Delete all revisions'
description: 'Role requires permission to <em>view Case Fee revisions</em> and <em>delete rights</em> for case fee entities in question or <em>administer case fee entities</em>.'

View File

@ -0,0 +1,25 @@
<?php
namespace Drupal\opencase_cases;
class CaseInvolvement {
public static function getLinkedActorId($account) {
return \Drupal\user\Entity\User::load($account->id())->get('field_linked_opencase_actor')->target_id;
}
public static function userIsInvolved($account, $case) {
$actorId = self::getLinkedActorId($account);
$query = \Drupal::entityQuery('oc_case_provision')
->condition('oc_provider', $actorId)
->condition('oc_case', $case->id());
$results = $query->execute();
return !empty($results);
}
public static function userIsInvolved_activity($account, $activity) {
$case_id = $activity->oc_case->target_id;
$case = \Drupal::entityTypeManager()->getStorage('oc_case')->load($case_id);
return self::userIsInvolved($account, $case);
}
}

View File

@ -0,0 +1,166 @@
<?php
namespace Drupal\opencase_cases\Controller;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Url;
use Drupal\opencase_cases\Entity\OCCaseInterface;
/**
* Class OCCaseController.
*
* Returns responses for Case routes.
*/
class OCCaseController extends ControllerBase implements ContainerInjectionInterface {
/**
* Displays a Case revision.
*
* @param int $oc_case_revision
* The Case revision ID.
*
* @return array
* An array suitable for drupal_render().
*/
public function revisionShow($oc_case_revision) {
$oc_case = $this->entityTypeManager()->getStorage('oc_case')->loadRevision($oc_case_revision);
$view_builder = $this->entityTypeManager()->getViewBuilder('oc_case');
return $view_builder->view($oc_case);
}
/**
* Page title callback for a Case revision.
*
* @param int $oc_case_revision
* The Case revision ID.
*
* @return string
* The page title.
*/
public function revisionPageTitle($oc_case_revision) {
$oc_case = $this->entityTypeManager()->getStorage('oc_case')->loadRevision($oc_case_revision);
$date = \Drupal::service('date.formatter')->format($oc_case->getRevisionCreationTime());
return $this->t('Revision of %title from %date', ['%title' => $oc_case->label(), '%date' => $date]);
}
/**
* Generates an overview table of older revisions of a Case .
*
* @param \Drupal\opencase_cases\Entity\OCCaseInterface $oc_case
* A Case object.
*
* @return array
* An array as expected by drupal_render().
*/
public function revisionOverview(OCCaseInterface $oc_case) {
$account = $this->currentUser();
$langcode = $oc_case->language()->getId();
$langname = $oc_case->language()->getName();
$languages = $oc_case->getTranslationLanguages();
$has_translations = (count($languages) > 1);
$oc_case_storage = $this->entityTypeManager()->getStorage('oc_case');
$build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $oc_case->label()]) : $this->t('Revisions for %title', ['%title' => $oc_case->label()]);
$header = [$this->t('Revision'), $this->t('Operations')];
$revert_permission = (($account->hasPermission("revert all case revisions") || $account->hasPermission('administer case entities')));
$delete_permission = (($account->hasPermission("delete all case revisions") || $account->hasPermission('administer case entities')));
$rows = [];
$vids = $oc_case_storage->revisionIds($oc_case);
$latest_revision = TRUE;
foreach (array_reverse($vids) as $vid) {
/** @var \Drupal\opencase_cases\OCCaseInterface $revision */
$revision = $oc_case_storage->loadRevision($vid);
// Only show revisions that are affected by the language that is being
// displayed.
if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {
$username = [
'#theme' => 'username',
'#account' => $revision->getRevisionUser(),
];
// Use revision link to link to revisions that are not active.
$date = \Drupal::service('date.formatter')->format($revision->getRevisionCreationTime(), 'short');
if ($vid != $oc_case->getRevisionId()) {
$url = new Url('entity.oc_case.revision', ['oc_case' => $oc_case->id(), 'oc_case_revision' => $vid]);
$link = \Drupal\Core\Link::fromTextAndUrl($date, $url)->toString();
}
else {
$link = $oc_case->toLink($date)->toString();
}
$row = [];
$column = [
'data' => [
'#type' => 'inline_template',
'#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class="revision-log">{{ message }}</p>{% endif %}',
'#context' => [
'date' => $link,
'username' => \Drupal::service('renderer')->renderPlain($username),
'message' => ['#markup' => $revision->getRevisionLogMessage(), '#allowed_tags' => Xss::getHtmlTagList()],
],
],
];
$row[] = $column;
if ($latest_revision) {
$row[] = [
'data' => [
'#prefix' => '<em>',
'#markup' => $this->t('Current revision'),
'#suffix' => '</em>',
],
];
foreach ($row as &$current) {
$current['class'] = ['revision-current'];
}
$latest_revision = FALSE;
}
else {
$links = [];
if ($revert_permission) {
$links['revert'] = [
'title' => $this->t('Revert'),
'url' => $has_translations ?
Url::fromRoute('entity.oc_case.translation_revert', ['oc_case' => $oc_case->id(), 'oc_case_revision' => $vid, 'langcode' => $langcode]) :
Url::fromRoute('entity.oc_case.revision_revert', ['oc_case' => $oc_case->id(), 'oc_case_revision' => $vid]),
];
}
if ($delete_permission) {
$links['delete'] = [
'title' => $this->t('Delete'),
'url' => Url::fromRoute('entity.oc_case.revision_delete', ['oc_case' => $oc_case->id(), 'oc_case_revision' => $vid]),
];
}
$row[] = [
'data' => [
'#type' => 'operations',
'#links' => $links,
],
];
}
$rows[] = $row;
}
}
$build['oc_case_revisions_table'] = [
'#theme' => 'table',
'#rows' => $rows,
'#header' => $header,
];
return $build;
}
}

View File

@ -0,0 +1,210 @@
<?php
namespace Drupal\opencase_cases\Controller;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Url;
use Drupal\opencase_cases\Entity\OCCaseFeeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Class OCCaseFeeController.
*
* Returns responses for Case Fee routes.
*/
class OCCaseFeeController extends ControllerBase implements ContainerInjectionInterface {
/**
* The date formatter.
*
* @var \Drupal\Core\Datetime\DateFormatter
*/
protected $dateFormatter;
/**
* The renderer.
*
* @var \Drupal\Core\Render\Renderer
*/
protected $renderer;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
$instance = parent::create($container);
$instance->dateFormatter = $container->get('date.formatter');
$instance->renderer = $container->get('renderer');
return $instance;
}
/**
* Displays a Case Fee revision.
*
* @param int $oc_case_fee_revision
* The Case Fee revision ID.
*
* @return array
* An array suitable for drupal_render().
*/
public function revisionShow($oc_case_fee_revision) {
$oc_case_fee = $this->entityTypeManager()->getStorage('oc_case_fee')
->loadRevision($oc_case_fee_revision);
$view_builder = $this->entityTypeManager()->getViewBuilder('oc_case_fee');
return $view_builder->view($oc_case_fee);
}
/**
* Page title callback for a Case Fee revision.
*
* @param int $oc_case_fee_revision
* The Case Fee revision ID.
*
* @return string
* The page title.
*/
public function revisionPageTitle($oc_case_fee_revision) {
$oc_case_fee = $this->entityTypeManager()->getStorage('oc_case_fee')
->loadRevision($oc_case_fee_revision);
return $this->t('Revision of %title from %date', [
'%title' => $oc_case_fee->label(),
'%date' => $this->dateFormatter->format($oc_case_fee->getRevisionCreationTime()),
]);
}
/**
* Generates an overview table of older revisions of a Case Fee.
*
* @param \Drupal\opencase_cases\Entity\OCCaseFeeInterface $oc_case_fee
* A Case Fee object.
*
* @return array
* An array as expected by drupal_render().
*/
public function revisionOverview(OCCaseFeeInterface $oc_case_fee) {
$account = $this->currentUser();
$oc_case_fee_storage = $this->entityTypeManager()->getStorage('oc_case_fee');
$langcode = $oc_case_fee->language()->getId();
$langname = $oc_case_fee->language()->getName();
$languages = $oc_case_fee->getTranslationLanguages();
$has_translations = (count($languages) > 1);
$build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $oc_case_fee->label()]) : $this->t('Revisions for %title', ['%title' => $oc_case_fee->label()]);
$header = [$this->t('Revision'), $this->t('Operations')];
$revert_permission = (($account->hasPermission("revert all case fee revisions") || $account->hasPermission('administer case fee entities')));
$delete_permission = (($account->hasPermission("delete all case fee revisions") || $account->hasPermission('administer case fee entities')));
$rows = [];
$vids = $oc_case_fee_storage->revisionIds($oc_case_fee);
$latest_revision = TRUE;
foreach (array_reverse($vids) as $vid) {
/** @var \Drupal\opencase_cases\OCCaseFeeInterface $revision */
$revision = $oc_case_fee_storage->loadRevision($vid);
// Only show revisions that are affected by the language that is being
// displayed.
if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {
$username = [
'#theme' => 'username',
'#account' => $revision->getRevisionUser(),
];
// Use revision link to link to revisions that are not active.
$date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');
if ($vid != $oc_case_fee->getRevisionId()) {
$url = new Url('entity.oc_case_fee.revision', [
'oc_case_fee' => $oc_case_fee->id(),
'oc_case_fee_revision' => $vid,
]);
$link = \Drupal\Core\Link::fromTextAndUrl($date, $url)->toString();
}
else {
$link = $oc_case_fee->toLink($date)->toString();
}
$row = [];
$column = [
'data' => [
'#type' => 'inline_template',
'#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class="revision-log">{{ message }}</p>{% endif %}',
'#context' => [
'date' => $link,
'username' => $this->renderer->renderPlain($username),
'message' => [
'#markup' => $revision->getRevisionLogMessage(),
'#allowed_tags' => Xss::getHtmlTagList(),
],
],
],
];
$row[] = $column;
if ($latest_revision) {
$row[] = [
'data' => [
'#prefix' => '<em>',
'#markup' => $this->t('Current revision'),
'#suffix' => '</em>',
],
];
foreach ($row as &$current) {
$current['class'] = ['revision-current'];
}
$latest_revision = FALSE;
}
else {
$links = [];
if ($revert_permission) {
$links['revert'] = [
'title' => $this->t('Revert'),
'url' => $has_translations ?
Url::fromRoute('entity.oc_case_fee.translation_revert', [
'oc_case_fee' => $oc_case_fee->id(),
'oc_case_fee_revision' => $vid,
'langcode' => $langcode,
]) :
Url::fromRoute('entity.oc_case_fee.revision_revert', [
'oc_case_fee' => $oc_case_fee->id(),
'oc_case_fee_revision' => $vid,
]),
];
}
if ($delete_permission) {
$links['delete'] = [
'title' => $this->t('Delete'),
'url' => Url::fromRoute('entity.oc_case_fee.revision_delete', [
'oc_case_fee' => $oc_case_fee->id(),
'oc_case_fee_revision' => $vid,
]),
];
}
$row[] = [
'data' => [
'#type' => 'operations',
'#links' => $links,
],
];
}
$rows[] = $row;
}
}
$build['oc_case_fee_revisions_table'] = [
'#theme' => 'table',
'#rows' => $rows,
'#header' => $header,
];
return $build;
}
}

View File

@ -0,0 +1,210 @@
<?php
namespace Drupal\opencase_cases\Controller;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Url;
use Drupal\opencase_cases\Entity\OCCaseProvisionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Class OCCaseProvisionController.
*
* Returns responses for Case Provision routes.
*/
class OCCaseProvisionController extends ControllerBase implements ContainerInjectionInterface {
/**
* The date formatter.
*
* @var \Drupal\Core\Datetime\DateFormatter
*/
protected $dateFormatter;
/**
* The renderer.
*
* @var \Drupal\Core\Render\Renderer
*/
protected $renderer;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
$instance = parent::create($container);
$instance->dateFormatter = $container->get('date.formatter');
$instance->renderer = $container->get('renderer');
return $instance;
}
/**
* Displays a Case Provision revision.
*
* @param int $oc_case_provision_revision
* The Case Provision revision ID.
*
* @return array
* An array suitable for drupal_render().
*/
public function revisionShow($oc_case_provision_revision) {
$oc_case_provision = $this->entityTypeManager()->getStorage('oc_case_provision')
->loadRevision($oc_case_provision_revision);
$view_builder = $this->entityTypeManager()->getViewBuilder('oc_case_provision');
return $view_builder->view($oc_case_provision);
}
/**
* Page title callback for a Case Provision revision.
*
* @param int $oc_case_provision_revision
* The Case Provision revision ID.
*
* @return string
* The page title.
*/
public function revisionPageTitle($oc_case_provision_revision) {
$oc_case_provision = $this->entityTypeManager()->getStorage('oc_case_provision')
->loadRevision($oc_case_provision_revision);
return $this->t('Revision of %title from %date', [
'%title' => $oc_case_provision->label(),
'%date' => $this->dateFormatter->format($oc_case_provision->getRevisionCreationTime()),
]);
}
/**
* Generates an overview table of older revisions of a Case Provision.
*
* @param \Drupal\opencase_cases\Entity\OCCaseProvisionInterface $oc_case_provision
* A Case Provision object.
*
* @return array
* An array as expected by drupal_render().
*/
public function revisionOverview(OCCaseProvisionInterface $oc_case_provision) {
$account = $this->currentUser();
$oc_case_provision_storage = $this->entityTypeManager()->getStorage('oc_case_provision');
$langcode = $oc_case_provision->language()->getId();
$langname = $oc_case_provision->language()->getName();
$languages = $oc_case_provision->getTranslationLanguages();
$has_translations = (count($languages) > 1);
$build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $oc_case_provision->label()]) : $this->t('Revisions for %title', ['%title' => $oc_case_provision->label()]);
$header = [$this->t('Revision'), $this->t('Operations')];
$revert_permission = (($account->hasPermission("revert all case provision revisions") || $account->hasPermission('administer case provision entities')));
$delete_permission = (($account->hasPermission("delete all case provision revisions") || $account->hasPermission('administer case provision entities')));
$rows = [];
$vids = $oc_case_provision_storage->revisionIds($oc_case_provision);
$latest_revision = TRUE;
foreach (array_reverse($vids) as $vid) {
/** @var \Drupal\opencase_cases\OCCaseProvisionInterface $revision */
$revision = $oc_case_provision_storage->loadRevision($vid);
// Only show revisions that are affected by the language that is being
// displayed.
if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {
$username = [
'#theme' => 'username',
'#account' => $revision->getRevisionUser(),
];
// Use revision link to link to revisions that are not active.
$date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');
if ($vid != $oc_case_provision->getRevisionId()) {
$url = new Url('entity.oc_case_provision.revision', [
'oc_case_provision' => $oc_case_provision->id(),
'oc_case_provision_revision' => $vid,
]);
$link = \Drupal\Core\Link::fromTextAndUrl($date, $url)->toString();
}
else {
$link = $oc_case_provision->toLink($date)->toString();
}
$row = [];
$column = [
'data' => [
'#type' => 'inline_template',
'#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class="revision-log">{{ message }}</p>{% endif %}',
'#context' => [
'date' => $link,
'username' => $this->renderer->renderPlain($username),
'message' => [
'#markup' => $revision->getRevisionLogMessage(),
'#allowed_tags' => Xss::getHtmlTagList(),
],
],
],
];
$row[] = $column;
if ($latest_revision) {
$row[] = [
'data' => [
'#prefix' => '<em>',
'#markup' => $this->t('Current revision'),
'#suffix' => '</em>',
],
];
foreach ($row as &$current) {
$current['class'] = ['revision-current'];
}
$latest_revision = FALSE;
}
else {
$links = [];
if ($revert_permission) {
$links['revert'] = [
'title' => $this->t('Revert'),
'url' => $has_translations ?
Url::fromRoute('entity.oc_case_provision.translation_revert', [
'oc_case_provision' => $oc_case_provision->id(),
'oc_case_provision_revision' => $vid,
'langcode' => $langcode,
]) :
Url::fromRoute('entity.oc_case_provision.revision_revert', [
'oc_case_provision' => $oc_case_provision->id(),
'oc_case_provision_revision' => $vid,
]),
];
}
if ($delete_permission) {
$links['delete'] = [
'title' => $this->t('Delete'),
'url' => Url::fromRoute('entity.oc_case_provision.revision_delete', [
'oc_case_provision' => $oc_case_provision->id(),
'oc_case_provision_revision' => $vid,
]),
];
}
$row[] = [
'data' => [
'#type' => 'operations',
'#links' => $links,
],
];
}
$rows[] = $row;
}
}
$build['oc_case_provision_revisions_table'] = [
'#theme' => 'table',
'#rows' => $rows,
'#header' => $header,
];
return $build;
}
}

View File

@ -0,0 +1,333 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\RevisionableContentEntityBase;
use Drupal\Core\Entity\RevisionableInterface;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\user\UserInterface;
/**
* Defines the Case entity.
*
* @ingroup opencase_cases
*
* @ContentEntityType(
* id = "oc_case",
* label = @Translation("Case"),
* bundle_label = @Translation("Case type"),
* handlers = {
* "storage" = "Drupal\opencase_cases\OCCaseStorage",
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\opencase_cases\OCCaseListBuilder",
* "views_data" = "Drupal\opencase_cases\Entity\OCCaseViewsData",
* "translation" = "Drupal\opencase_cases\OCCaseTranslationHandler",
*
* "form" = {
* "default" = "Drupal\opencase_cases\Form\OCCaseForm",
* "add" = "Drupal\opencase_cases\Form\OCCaseForm",
* "edit" = "Drupal\opencase_cases\Form\OCCaseForm",
* "delete" = "Drupal\opencase_cases\Form\OCCaseDeleteForm",
* },
* "access" = "Drupal\opencase_cases\OCCaseAccessControlHandler",
* "route_provider" = {
* "html" = "Drupal\opencase_cases\OCCaseHtmlRouteProvider",
* },
* },
* base_table = "oc_case",
* data_table = "oc_case_field_data",
* revision_table = "oc_case_revision",
* revision_data_table = "oc_case_field_revision",
* revision_metadata_keys = {
* "revision_user" = "revision_user",
* "revision_created" = "revision_created",
* "revision_log_message" = "revision_log"
* },
* translatable = TRUE,
* admin_permission = "administer case entities",
* entity_keys = {
* "id" = "id",
* "revision" = "vid",
* "bundle" = "type",
* "label" = "name",
* "uuid" = "uuid",
* "uid" = "user_id",
* "langcode" = "langcode",
* "status" = "status",
* },
* links = {
* "canonical" = "/opencase/oc_case/{oc_case}",
* "add-page" = "/opencase/oc_case/add",
* "add-form" = "/opencase/oc_case/add/{oc_case_type}",
* "edit-form" = "/opencase/oc_case/{oc_case}/edit",
* "delete-form" = "/opencase/oc_case/{oc_case}/delete",
* "version-history" = "/opencase/oc_case/{oc_case}/revisions",
* "revision" = "/opencase/oc_case/{oc_case}/revisions/{oc_case_revision}/view",
* "revision_revert" = "/opencase/oc_case/{oc_case}/revisions/{oc_case_revision}/revert",
* "revision_delete" = "/opencase/oc_case/{oc_case}/revisions/{oc_case_revision}/delete",
* "translation_revert" = "/opencase/oc_case/{oc_case}/revisions/{oc_case_revision}/revert/{langcode}",
* "collection" = "/opencase/oc_case",
* },
* bundle_entity_type = "oc_case_type",
* field_ui_base_route = "entity.oc_case_type.edit_form"
* )
*/
class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
use EntityChangedTrait;
/**
* {@inheritdoc}
*/
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values);
$values += [
'user_id' => \Drupal::currentUser()->id(),
];
}
public static function defaultTarget() {
if (opencase_entities_get('target_id')) return [opencase_entities_get('target_id')];
else return [];
}
/**
* {@inheritdoc}
*/
protected function urlRouteParameters($rel) {
$uri_route_parameters = parent::urlRouteParameters($rel);
if ($rel === 'revision_revert' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId();
}
elseif ($rel === 'revision_delete' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId();
}
return $uri_route_parameters;
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
foreach (array_keys($this->getTranslationLanguages()) as $langcode) {
$translation = $this->getTranslation($langcode);
// If no owner has been set explicitly, make the anonymous user the owner.
if (!$translation->getOwner()) {
$translation->setOwnerId(0);
}
}
// If no revision author has been set explicitly, make the oc_case owner the
// revision author.
if (!$this->getRevisionUser()) {
$this->setRevisionUserId($this->getOwnerId());
}
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->get('name')->value;
}
/**
* {@inheritdoc}
*/
public function setName($name) {
$this->set('name', $name);
return $this;
}
/**
* {@inheritdoc}
*/
public function getCreatedTime() {
return $this->get('created')->value;
}
/**
* {@inheritdoc}
*/
public function setCreatedTime($timestamp) {
$this->set('created', $timestamp);
return $this;
}
/**
* {@inheritdoc}
*/
public function getOwner() {
return $this->get('user_id')->entity;
}
/**
* {@inheritdoc}
*/
public function getOwnerId() {
return $this->get('user_id')->target_id;
}
/**
* {@inheritdoc}
*/
public function setOwnerId($uid) {
$this->set('user_id', $uid);
return $this;
}
/**
* {@inheritdoc}
*/
public function setOwner(UserInterface $account) {
$this->set('user_id', $account->id());
return $this;
}
/**
* {@inheritdoc}
*/
public function isPublished() {
return (bool) $this->getEntityKey('status');
}
/**
* {@inheritdoc}
*/
public function setPublished($published) {
$this->set('status', $published ? TRUE : FALSE);
return $this;
}
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
// not currently used. Will add form and view settings when ready
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Visible'))
->setDescription('If this box is not ticked this record will be hidden from view for most users. Users with access to unpublished entities will be able to restore it if needed.')
->setRevisionable(TRUE)
->setDisplayConfigurable("form", TRUE)
->setDefaultValue(TRUE);
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Created by'))
->setDescription(t('The user ID of author of the Case entity.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true)
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'author',
'weight' => 80,
]);
$fields['oc_target'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Target'))
->setRevisionable(TRUE)
->setSetting('target_type', 'oc_actor')
->setSetting('handler', 'default')
->setDefaultValueCallback('\Drupal\opencase_cases\Entity\OCCase::defaultTarget')
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Title'))
->setRevisionable(TRUE)
->setSettings([
'max_length' => 120,
'text_processing' => 0,
])
->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'string',
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -100,
])
->setRequired(TRUE);
$fields['files'] = BaseFieldDefinition::create('file')
->setLabel(t('Files'))
->setDescription(t('Files attached to this case'))
->setSetting('file_directory', '[date:custom:Y]-[date:custom:m]')
->setSetting('handler', 'default:file')
->setSetting('file_extensions', 'txt jpg jpeg gif rtf xls xlsx doc swf png pdf docx csv')
->setSetting('description_field', 'true')
->setSetting('uri_scheme', 'private')
->setCardinality(-1)
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true)
->setDisplayOptions('form', [
'type' => 'file_generic',
'weight' => -1,
'settings' => [
'progress_indicator' => 'throbber',
],
])
->setDisplayOptions('view', [
'label' => 'above',
'settings' => ['use_description_as_link_text' => 'true']
]);
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created on'))
->setDescription(t('When the case was created.'))
->setDisplayConfigurable('view', true);
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Last updated'))
->setDescription(t('When the case was last edited.'))
->setDisplayConfigurable('view', true);
$fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Revision translation affected'))
->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
->setReadOnly(TRUE)
->setRevisionable(TRUE)
->setTranslatable(TRUE);
$fields['notes'] = BaseFieldDefinition::create('string_long')
->setRevisionable(TRUE)
->setLabel(t('Notes'))
->setSettings(array(
'default_value' => '',
'max_length' => 255,
'text_processing' => 0,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
$fields['total_fee'] = BaseFieldDefinition::create('decimal')
->setLabel(t('Total Fee'))
->setRevisionable(TRUE)
->setSettings([
'prefix' => '£',
])
->SetDisplayConfigurable("view", true);
return $fields;
}
}

View File

@ -0,0 +1,303 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\EditorialContentEntityBase;
use Drupal\Core\Entity\RevisionableInterface;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityPublishedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\user\UserInterface;
/**
* Defines the Case Fee entity.
*
* @ingroup opencase_cases
*
* @ContentEntityType(
* id = "oc_case_fee",
* label = @Translation("Case Fee"),
* bundle_label = @Translation("Case Fee type"),
* handlers = {
* "storage" = "Drupal\opencase_cases\OCCaseFeeStorage",
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\opencase_cases\OCCaseFeeListBuilder",
* "views_data" = "Drupal\opencase_cases\Entity\OCCaseFeeViewsData",
* "translation" = "Drupal\opencase_cases\OCCaseFeeTranslationHandler",
*
* "form" = {
* "default" = "Drupal\opencase_cases\Form\OCCaseFeeForm",
* "add" = "Drupal\opencase_cases\Form\OCCaseFeeForm",
* "edit" = "Drupal\opencase_cases\Form\OCCaseFeeForm",
* "delete" = "Drupal\opencase_cases\Form\OCCaseFeeDeleteForm",
* },
* "route_provider" = {
* "html" = "Drupal\opencase_cases\OCCaseFeeHtmlRouteProvider",
* },
* "access" = "Drupal\opencase_cases\OCCaseFeeAccessControlHandler",
* },
* base_table = "oc_case_fee",
* data_table = "oc_case_fee_field_data",
* revision_table = "oc_case_fee_revision",
* revision_data_table = "oc_case_fee_field_revision",
* translatable = TRUE,
* permission_granularity = "bundle",
* admin_permission = "administer case fee entities",
* entity_keys = {
* "id" = "id",
* "revision" = "vid",
* "bundle" = "type",
* "label" = "name",
* "uuid" = "uuid",
* "uid" = "user_id",
* "langcode" = "langcode",
* "published" = "status",
* },
* revision_metadata_keys = {
* "revision_user" = "revision_user",
* "revision_created" = "revision_created",
* "revision_log_message" = "revision_log",
* },
* links = {
* "canonical" = "/opencase/oc_case_fee/{oc_case_fee}",
* "add-page" = "/opencase/oc_case_fee/add",
* "add-form" = "/opencase/oc_case_fee/add/{oc_case_fee_type}",
* "edit-form" = "/opencase/oc_case_fee/{oc_case_fee}/edit",
* "delete-form" = "/opencase/oc_case_fee/{oc_case_fee}/delete",
* "version-history" = "/opencase/oc_case_fee/{oc_case_fee}/revisions",
* "revision" = "/opencase/oc_case_fee/{oc_case_fee}/revisions/{oc_case_fee_revision}/view",
* "revision_revert" = "/opencase/oc_case_fee/{oc_case_fee}/revisions/{oc_case_fee_revision}/revert",
* "revision_delete" = "/opencase/oc_case_fee/{oc_case_fee}/revisions/{oc_case_fee_revision}/delete",
* "translation_revert" = "/opencase/oc_case_fee/{oc_case_fee}/revisions/{oc_case_fee_revision}/revert/{langcode}",
* "collection" = "/opencase/oc_case_fee",
* },
* bundle_entity_type = "oc_case_fee_type",
* field_ui_base_route = "entity.oc_case_fee_type.edit_form"
* )
*/
class OCCaseFee extends EditorialContentEntityBase implements OCCaseFeeInterface {
use EntityChangedTrait;
use EntityPublishedTrait;
/**
* {@inheritdoc}
*/
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values);
$values += [
'user_id' => \Drupal::currentUser()->id(),
];
}
/**
* {@inheritdoc}
*/
protected function urlRouteParameters($rel) {
$uri_route_parameters = parent::urlRouteParameters($rel);
if ($rel === 'revision_revert' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId();
}
elseif ($rel === 'revision_delete' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId();
}
return $uri_route_parameters;
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
foreach (array_keys($this->getTranslationLanguages()) as $langcode) {
$translation = $this->getTranslation($langcode);
// If no owner has been set explicitly, make the anonymous user the owner.
if (!$translation->getOwner()) {
$translation->setOwnerId(0);
}
}
// If no revision author has been set explicitly,
// make the oc_case_fee owner the revision author.
if (!$this->getRevisionUser()) {
$this->setRevisionUserId($this->getOwnerId());
}
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->get('name')->value;
}
/**
* {@inheritdoc}
*/
public function setName($name) {
$this->set('name', $name);
return $this;
}
/**
* {@inheritdoc}
*/
public function getCreatedTime() {
return $this->get('created')->value;
}
/**
* {@inheritdoc}
*/
public function setCreatedTime($timestamp) {
$this->set('created', $timestamp);
return $this;
}
/**
* {@inheritdoc}
*/
public function getOwner() {
return $this->get('user_id')->entity;
}
/**
* {@inheritdoc}
*/
public function getOwnerId() {
return $this->get('user_id')->target_id;
}
/**
* {@inheritdoc}
*/
public function setOwnerId($uid) {
$this->set('user_id', $uid);
return $this;
}
/**
* {@inheritdoc}
*/
public function setOwner(UserInterface $account) {
$this->set('user_id', $account->id());
return $this;
}
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
// Add the published field.
$fields += static::publishedBaseFieldDefinitions($entity_type);
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Authored by'))
->setDescription(t('The user ID of author of the Case Fee entity.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'author',
'weight' => 0,
])
->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => [
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
],
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the Case Fee entity.'))
->setRevisionable(TRUE)
->setSettings([
'max_length' => 50,
'text_processing' => 0,
])
->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => -4,
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -4,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setRequired(TRUE);
$fields['status']->setDescription(t('A boolean indicating whether the Case Fee is published.'))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))
->setDescription(t('The time that the entity was created.'));
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time that the entity was last edited.'));
$fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Revision translation affected'))
->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
->setReadOnly(TRUE)
->setRevisionable(TRUE)
->setTranslatable(TRUE);
$fields['oc_case'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Case'))
->setSetting('target_type', 'oc_case')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setCardinality(1)
->setDefaultValueCallback('opencase_cases_default_case_id') // defined in opencase_cases.module
->setDisplayConfigurable("view", true)
->setDisplayConfigurable("form", true)
->setRequired(TRUE);
$fields['oc_fee_category'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Fee Category'))
->setSetting('target_type', 'taxonomy_term')
->setSetting('handler_settings', ['target_bundles' => ['oc_fee_category' => 'oc_fee_category']])
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setCardinality(1)
->setDisplayConfigurable("view", true)
->setDisplayConfigurable("form", true)
->setRequired(FALSE);
$fields['amount'] = BaseFieldDefinition::create('decimal')
->setLabel(t('Amount'))
->setRevisionable(TRUE)
->setSettings([
'prefix' => '£',
])
->setRequired(TRUE)
->SetDisplayConfigurable("form", true)
->SetDisplayConfigurable("view", true);
return $fields;
}
}

View File

@ -0,0 +1,98 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\RevisionLogInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\Core\Entity\EntityPublishedInterface;
use Drupal\user\EntityOwnerInterface;
/**
* Provides an interface for defining Case Fee entities.
*
* @ingroup opencase_cases
*/
interface OCCaseFeeInterface extends ContentEntityInterface, RevisionLogInterface, EntityChangedInterface, EntityPublishedInterface, EntityOwnerInterface {
/**
* Add get/set methods for your configuration properties here.
*/
/**
* Gets the Case Fee name.
*
* @return string
* Name of the Case Fee.
*/
public function getName();
/**
* Sets the Case Fee name.
*
* @param string $name
* The Case Fee name.
*
* @return \Drupal\opencase_cases\Entity\OCCaseFeeInterface
* The called Case Fee entity.
*/
public function setName($name);
/**
* Gets the Case Fee creation timestamp.
*
* @return int
* Creation timestamp of the Case Fee.
*/
public function getCreatedTime();
/**
* Sets the Case Fee creation timestamp.
*
* @param int $timestamp
* The Case Fee creation timestamp.
*
* @return \Drupal\opencase_cases\Entity\OCCaseFeeInterface
* The called Case Fee entity.
*/
public function setCreatedTime($timestamp);
/**
* Gets the Case Fee revision creation timestamp.
*
* @return int
* The UNIX timestamp of when this revision was created.
*/
public function getRevisionCreationTime();
/**
* Sets the Case Fee revision creation timestamp.
*
* @param int $timestamp
* The UNIX timestamp of when this revision was created.
*
* @return \Drupal\opencase_cases\Entity\OCCaseFeeInterface
* The called Case Fee entity.
*/
public function setRevisionCreationTime($timestamp);
/**
* Gets the Case Fee revision author.
*
* @return \Drupal\user\UserInterface
* The user entity for the revision author.
*/
public function getRevisionUser();
/**
* Sets the Case Fee revision author.
*
* @param int $uid
* The user ID of the revision author.
*
* @return \Drupal\opencase_cases\Entity\OCCaseFeeInterface
* The called Case Fee entity.
*/
public function setRevisionUserId($uid);
}

View File

@ -0,0 +1,63 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
/**
* Defines the Case Fee type entity.
*
* @ConfigEntityType(
* id = "oc_case_fee_type",
* label = @Translation("Case Fee type"),
* handlers = {
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\opencase_cases\OCCaseFeeTypeListBuilder",
* "form" = {
* "add" = "Drupal\opencase_cases\Form\OCCaseFeeTypeForm",
* "edit" = "Drupal\opencase_cases\Form\OCCaseFeeTypeForm",
* "delete" = "Drupal\opencase_cases\Form\OCCaseFeeTypeDeleteForm"
* },
* "route_provider" = {
* "html" = "Drupal\opencase_cases\OCCaseFeeTypeHtmlRouteProvider",
* },
* },
* config_prefix = "oc_case_fee_type",
* admin_permission = "administer site configuration",
* bundle_of = "oc_case_fee",
* entity_keys = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid"
* },
* config_export = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid"
* },
* links = {
* "canonical" = "/opencase/oc_case_fee_type/{oc_case_fee_type}",
* "add-form" = "/opencase/oc_case_fee_type/add",
* "edit-form" = "/opencase/oc_case_fee_type/{oc_case_fee_type}/edit",
* "delete-form" = "/opencase/oc_case_fee_type/{oc_case_fee_type}/delete",
* "collection" = "/opencase/oc_case_fee_type"
* }
* )
*/
class OCCaseFeeType extends ConfigEntityBundleBase implements OCCaseFeeTypeInterface {
/**
* The Case Fee type ID.
*
* @var string
*/
protected $id;
/**
* The Case Fee type label.
*
* @var string
*/
protected $label;
}

View File

@ -0,0 +1,13 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
/**
* Provides an interface for defining Case Fee type entities.
*/
interface OCCaseFeeTypeInterface extends ConfigEntityInterface {
// Add get/set methods for your configuration properties here.
}

View File

@ -1,13 +1,13 @@
<?php
namespace Drupal\zencrm_entities\Entity;
namespace Drupal\opencase_cases\Entity;
use Drupal\views\EntityViewsData;
/**
* Provides Views data for Case entity entities.
* Provides Views data for Case Fee entities.
*/
class CaseEntityViewsData extends EntityViewsData {
class OCCaseFeeViewsData extends EntityViewsData {
/**
* {@inheritdoc}
@ -17,7 +17,6 @@ class CaseEntityViewsData extends EntityViewsData {
// Additional information for Views integration, such as table joins, can be
// put here.
return $data;
}

View File

@ -0,0 +1,116 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\RevisionLogInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\user\EntityOwnerInterface;
/**
* Provides an interface for defining Case entities.
*
* @ingroup opencase_cases
*/
interface OCCaseInterface extends ContentEntityInterface, RevisionLogInterface, EntityChangedInterface, EntityOwnerInterface {
// Add get/set methods for your configuration properties here.
/**
* Gets the Case name.
*
* @return string
* Name of the Case.
*/
public function getName();
/**
* Sets the Case name.
*
* @param string $name
* The Case name.
*
* @return \Drupal\opencase_cases\Entity\OCCaseInterface
* The called Case entity.
*/
public function setName($name);
/**
* Gets the Case creation timestamp.
*
* @return int
* Creation timestamp of the Case.
*/
public function getCreatedTime();
/**
* Sets the Case creation timestamp.
*
* @param int $timestamp
* The Case creation timestamp.
*
* @return \Drupal\opencase_cases\Entity\OCCaseInterface
* The called Case entity.
*/
public function setCreatedTime($timestamp);
/**
* Returns the Case published status indicator.
*
* Unpublished Case are only visible to restricted users.
*
* @return bool
* TRUE if the Case is published.
*/
public function isPublished();
/**
* Sets the published status of a Case.
*
* @param bool $published
* TRUE to set this Case to published, FALSE to set it to unpublished.
*
* @return \Drupal\opencase_cases\Entity\OCCaseInterface
* The called Case entity.
*/
public function setPublished($published);
/**
* Gets the Case revision creation timestamp.
*
* @return int
* The UNIX timestamp of when this revision was created.
*/
public function getRevisionCreationTime();
/**
* Sets the Case revision creation timestamp.
*
* @param int $timestamp
* The UNIX timestamp of when this revision was created.
*
* @return \Drupal\opencase_cases\Entity\OCCaseInterface
* The called Case entity.
*/
public function setRevisionCreationTime($timestamp);
/**
* Gets the Case revision author.
*
* @return \Drupal\user\UserInterface
* The user entity for the revision author.
*/
public function getRevisionUser();
/**
* Sets the Case revision author.
*
* @param int $uid
* The user ID of the revision author.
*
* @return \Drupal\opencase_cases\Entity\OCCaseInterface
* The called Case entity.
*/
public function setRevisionUserId($uid);
}

View File

@ -0,0 +1,314 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\EditorialContentEntityBase;
use Drupal\Core\Entity\RevisionableInterface;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityPublishedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\user\UserInterface;
/**
* Defines the Case Provision entity.
*
* @ingroup opencase_cases
*
* @ContentEntityType(
* id = "oc_case_provision",
* label = @Translation("Case Provision"),
* bundle_label = @Translation("Case Provision type"),
* handlers = {
* "storage" = "Drupal\opencase_cases\OCCaseProvisionStorage",
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\opencase_cases\OCCaseProvisionListBuilder",
* "views_data" = "Drupal\opencase_cases\Entity\OCCaseProvisionViewsData",
* "translation" = "Drupal\opencase_cases\OCCaseProvisionTranslationHandler",
*
* "form" = {
* "default" = "Drupal\opencase_cases\Form\OCCaseProvisionForm",
* "add" = "Drupal\opencase_cases\Form\OCCaseProvisionForm",
* "edit" = "Drupal\opencase_cases\Form\OCCaseProvisionForm",
* "delete" = "Drupal\opencase_cases\Form\OCCaseProvisionDeleteForm",
* },
* "route_provider" = {
* "html" = "Drupal\opencase_cases\OCCaseProvisionHtmlRouteProvider",
* },
* "access" = "Drupal\opencase_cases\OCCaseProvisionAccessControlHandler",
* },
* base_table = "oc_case_provision",
* data_table = "oc_case_provision_field_data",
* revision_table = "oc_case_provision_revision",
* revision_data_table = "oc_case_provision_field_revision",
* translatable = TRUE,
* permission_granularity = "bundle",
* admin_permission = "administer case provision entities",
* entity_keys = {
* "id" = "id",
* "revision" = "vid",
* "bundle" = "type",
* "label" = "name",
* "uuid" = "uuid",
* "uid" = "user_id",
* "langcode" = "langcode",
* "published" = "status",
* },
* revision_metadata_keys = {
* "revision_user" = "revision_user",
* "revision_created" = "revision_created",
* "revision_log_message" = "revision_log",
* },
* links = {
* "canonical" = "/opencase/oc_case_provision/{oc_case_provision}",
* "add-page" = "/opencase/oc_case_provision/add",
* "add-form" = "/opencase/oc_case_provision/add/{oc_case_provision_type}",
* "edit-form" = "/opencase/oc_case_provision/{oc_case_provision}/edit",
* "delete-form" = "/opencase/oc_case_provision/{oc_case_provision}/delete",
* "version-history" = "/opencase/oc_case_provision/{oc_case_provision}/revisions",
* "revision" = "/opencase/oc_case_provision/{oc_case_provision}/revisions/{oc_case_provision_revision}/view",
* "revision_revert" = "/opencase/oc_case_provision/{oc_case_provision}/revisions/{oc_case_provision_revision}/revert",
* "revision_delete" = "/opencase/oc_case_provision/{oc_case_provision}/revisions/{oc_case_provision_revision}/delete",
* "translation_revert" = "/opencase/oc_case_provision/{oc_case_provision}/revisions/{oc_case_provision_revision}/revert/{langcode}",
* "collection" = "/opencase/oc_case_provision",
* },
* bundle_entity_type = "oc_case_provision_type",
* field_ui_base_route = "entity.oc_case_provision_type.edit_form"
* )
*/
class OCCaseProvision extends EditorialContentEntityBase implements OCCaseProvisionInterface {
use EntityChangedTrait;
use EntityPublishedTrait;
/**
* {@inheritdoc}
*/
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values);
$values += [
'user_id' => \Drupal::currentUser()->id(),
];
}
/**
* {@inheritdoc}
*/
protected function urlRouteParameters($rel) {
$uri_route_parameters = parent::urlRouteParameters($rel);
if ($rel === 'revision_revert' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId();
}
elseif ($rel === 'revision_delete' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId();
}
return $uri_route_parameters;
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
foreach (array_keys($this->getTranslationLanguages()) as $langcode) {
$translation = $this->getTranslation($langcode);
// If no owner has been set explicitly, make the anonymous user the owner.
if (!$translation->getOwner()) {
$translation->setOwnerId(0);
}
}
// If no revision author has been set explicitly,
// make the oc_case_provision owner the revision author.
if (!$this->getRevisionUser()) {
$this->setRevisionUserId($this->getOwnerId());
}
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->get('name')->value;
}
/**
* {@inheritdoc}
*/
public function setName($name) {
$this->set('name', $name);
return $this;
}
/**
* {@inheritdoc}
*/
public function getCreatedTime() {
return $this->get('created')->value;
}
/**
* {@inheritdoc}
*/
public function setCreatedTime($timestamp) {
$this->set('created', $timestamp);
return $this;
}
/**
* {@inheritdoc}
*/
public function getOwner() {
return $this->get('user_id')->entity;
}
/**
* {@inheritdoc}
*/
public function getOwnerId() {
return $this->get('user_id')->target_id;
}
/**
* {@inheritdoc}
*/
public function setOwnerId($uid) {
$this->set('user_id', $uid);
return $this;
}
/**
* {@inheritdoc}
*/
public function setOwner(UserInterface $account) {
$this->set('user_id', $account->id());
return $this;
}
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
// Add the published field.
$fields += static::publishedBaseFieldDefinitions($entity_type);
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Authored by'))
->setDescription(t('The user ID of author of the Case Provision entity.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'author',
'weight' => 0,
])
->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => [
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
],
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the Case Provision entity.'))
->setRevisionable(TRUE)
->setSettings([
'max_length' => 50,
'text_processing' => 0,
])
->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => -4,
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -4,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setRequired(TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Visible'))
->setDescription('If this box is not ticked this record will be hidden from view for most users. Users with access to unpublished entities will be able to restore it if needed.')
->setRevisionable(TRUE)
->setDisplayConfigurable('form', TRUE)
->setDefaultValue(TRUE);
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))
->setDescription(t('The time that the entity was created.'));
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time that the entity was last edited.'));
$fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Revision translation affected'))
->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
->setReadOnly(TRUE)
->setRevisionable(TRUE)
->setTranslatable(TRUE);
$fields['oc_case'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Case'))
->setSetting('target_type', 'oc_case')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setCardinality(1)
->setDefaultValueCallback('opencase_cases_default_case_id') // defined in opencase_cases.module
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setRequired(TRUE);
$fields['oc_provider'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Provider'))
->setSetting('target_type', 'oc_actor') // TODO: this should eventually point to a Provider rather than an Actor
->setSetting('handler', 'views')
->setTranslatable(TRUE)
->setCardinality(1)
->setSetting('handler_settings', [
'view' => [
'view_name' => 'case_providers',
'display_name' => 'entity_reference_1',
'arguments' => [],
]
])
->setDisplayConfigurable("view", true)
->setDisplayConfigurable("form", true)
->setRequired(TRUE);
$fields['oc_case_provider_role'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Role'))
->setSetting('target_type', 'taxonomy_term')
->setSetting('handler_settings', ['target_bundles' => ['oc_case_provider_role' => 'oc_case_provider_role']])
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setCardinality(1)
->setDisplayConfigurable("view", true)
->setDisplayConfigurable("form", true)
->setRequired(FALSE);
return $fields;
}
}

View File

@ -0,0 +1,98 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\RevisionLogInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\Core\Entity\EntityPublishedInterface;
use Drupal\user\EntityOwnerInterface;
/**
* Provides an interface for defining Case Provision entities.
*
* @ingroup opencase_cases
*/
interface OCCaseProvisionInterface extends ContentEntityInterface, RevisionLogInterface, EntityChangedInterface, EntityPublishedInterface, EntityOwnerInterface {
/**
* Add get/set methods for your configuration properties here.
*/
/**
* Gets the Case Provision name.
*
* @return string
* Name of the Case Provision.
*/
public function getName();
/**
* Sets the Case Provision name.
*
* @param string $name
* The Case Provision name.
*
* @return \Drupal\opencase_cases\Entity\OCCaseProvisionInterface
* The called Case Provision entity.
*/
public function setName($name);
/**
* Gets the Case Provision creation timestamp.
*
* @return int
* Creation timestamp of the Case Provision.
*/
public function getCreatedTime();
/**
* Sets the Case Provision creation timestamp.
*
* @param int $timestamp
* The Case Provision creation timestamp.
*
* @return \Drupal\opencase_cases\Entity\OCCaseProvisionInterface
* The called Case Provision entity.
*/
public function setCreatedTime($timestamp);
/**
* Gets the Case Provision revision creation timestamp.
*
* @return int
* The UNIX timestamp of when this revision was created.
*/
public function getRevisionCreationTime();
/**
* Sets the Case Provision revision creation timestamp.
*
* @param int $timestamp
* The UNIX timestamp of when this revision was created.
*
* @return \Drupal\opencase_cases\Entity\OCCaseProvisionInterface
* The called Case Provision entity.
*/
public function setRevisionCreationTime($timestamp);
/**
* Gets the Case Provision revision author.
*
* @return \Drupal\user\UserInterface
* The user entity for the revision author.
*/
public function getRevisionUser();
/**
* Sets the Case Provision revision author.
*
* @param int $uid
* The user ID of the revision author.
*
* @return \Drupal\opencase_cases\Entity\OCCaseProvisionInterface
* The called Case Provision entity.
*/
public function setRevisionUserId($uid);
}

View File

@ -0,0 +1,63 @@
<?php
namespace Drupal\opencase_cases\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
/**
* Defines the Case Provision type entity.
*
* @ConfigEntityType(
* id = "oc_case_provision_type",
* label = @Translation("Case Provision type"),
* handlers = {
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\opencase_cases\OCCaseProvisionTypeListBuilder",
* "form" = {
* "add" = "Drupal\opencase_cases\Form\OCCaseProvisionTypeForm",
* "edit" = "Drupal\opencase_cases\Form\OCCaseProvisionTypeForm",
* "delete" = "Drupal\opencase_cases\Form\OCCaseProvisionTypeDeleteForm"
* },
* "route_provider" = {
* "html" = "Drupal\opencase_cases\OCCaseProvisionTypeHtmlRouteProvider",
* },
* },
* config_prefix = "oc_case_provision_type",
* admin_permission = "administer site configuration",
* bundle_of = "oc_case_provision",
* entity_keys = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid"
* },
* config_export = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid"
* },
* links = {
* "canonical" = "/opencase/oc_case_provision_type/{oc_case_provision_type}",
* "add-form" = "/opencase/oc_case_provision_type/add",
* "edit-form" = "/opencase/oc_case_provision_type/{oc_case_provision_type}/edit",
* "delete-form" = "/opencase/oc_case_provision_type/{oc_case_provision_type}/delete",
* "collection" = "/opencase/oc_case_provision_type"
* }
* )
*/
class OCCaseProvisionType extends ConfigEntityBundleBase implements OCCaseProvisionTypeInterface {
/**
* The Case Provision type ID.
*
* @var string
*/
protected $id;
/**
* The Case Provision type label.
*
* @var string
*/
protected $label;
}

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