From 794bc0da68ed9ecd2f09ce4af68faaf0d5bd7d10 Mon Sep 17 00:00:00 2001 From: naomi Date: Thu, 26 Aug 2021 21:41:36 +0100 Subject: [PATCH] Pulling case_id through when creating an activity and client_id when creating a case. (Only for demo really; bit of tech debt) --- modules/opencase_cases/src/Entity/OCCase.php | 4 ++++ .../templates/oc-case-content-add-list.html.twig | 6 +++--- modules/opencase_entities/opencase_entities.module | 1 + .../templates/oc-activity-content-add-list.html.twig | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/opencase_cases/src/Entity/OCCase.php b/modules/opencase_cases/src/Entity/OCCase.php index 2fb2a83..9e72375 100644 --- a/modules/opencase_cases/src/Entity/OCCase.php +++ b/modules/opencase_cases/src/Entity/OCCase.php @@ -217,6 +217,8 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { ->setSetting('target_type', 'user') ->setSetting('handler', 'default') ->setTranslatable(TRUE) + ->setDisplayConfigurable('form', true) + ->setDisplayConfigurable('view', true) ->setDisplayOptions('view', [ 'label' => 'above', 'type' => 'author', @@ -250,6 +252,8 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { ->setSetting('description_field', 'true') ->setSetting('uri_scheme', 'private') ->setCardinality(-1) + ->setDisplayConfigurable('form', true) + ->setDisplayConfigurable('view', true) ->setDisplayOptions('form', [ 'type' => 'file_generic', 'weight' => -1, diff --git a/modules/opencase_cases/templates/oc-case-content-add-list.html.twig b/modules/opencase_cases/templates/oc-case-content-add-list.html.twig index 9a3fa9b..bfd273a 100644 --- a/modules/opencase_cases/templates/oc-case-content-add-list.html.twig +++ b/modules/opencase_cases/templates/oc-case-content-add-list.html.twig @@ -9,15 +9,15 @@ * - link: A link to add a content entity of this type. * - description: A description of this content entity types/bundle. * - * @see template_preprocess_oc_case_content_add_list() + * @see template_preprocess_oc_activity_content_add_list() * * @ingroup themeable */ #} {% spaceless %}
- {% for type in types %} -
{{ type.link }}
+ {% for id,type in bundles %} +
{{ type.label }}
{% endfor %}
{% endspaceless %} diff --git a/modules/opencase_entities/opencase_entities.module b/modules/opencase_entities/opencase_entities.module index ab1d871..d07ebd8 100644 --- a/modules/opencase_entities/opencase_entities.module +++ b/modules/opencase_entities/opencase_entities.module @@ -60,6 +60,7 @@ function opencase_entities_theme() { $theme['oc_activity_content_add_list'] = [ 'render element' => 'content', 'variables' => ['content' => NULL], + 'template' => 'oc-activity-content-add-list', 'file' => 'oc_activity.page.inc', ]; $theme['oc_organisation'] = [ diff --git a/modules/opencase_entities/templates/oc-activity-content-add-list.html.twig b/modules/opencase_entities/templates/oc-activity-content-add-list.html.twig index 7d4e5cc..c9ed927 100644 --- a/modules/opencase_entities/templates/oc-activity-content-add-list.html.twig +++ b/modules/opencase_entities/templates/oc-activity-content-add-list.html.twig @@ -16,8 +16,8 @@ #} {% spaceless %}
- {% for type in types %} -
{{ type.link }}
+ {% for id,type in bundles %} +
{{ type.label }}
{% endfor %}
{% endspaceless %}