Pulling case_id through when creating an activity and client_id when creating a case. (Only for demo really; bit of tech debt)

This commit is contained in:
naomi 2021-08-26 21:41:36 +01:00
parent 3586ef5788
commit 794bc0da68
4 changed files with 10 additions and 5 deletions

View File

@ -217,6 +217,8 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
->setSetting('target_type', 'user') ->setSetting('target_type', 'user')
->setSetting('handler', 'default') ->setSetting('handler', 'default')
->setTranslatable(TRUE) ->setTranslatable(TRUE)
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true)
->setDisplayOptions('view', [ ->setDisplayOptions('view', [
'label' => 'above', 'label' => 'above',
'type' => 'author', 'type' => 'author',
@ -250,6 +252,8 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
->setSetting('description_field', 'true') ->setSetting('description_field', 'true')
->setSetting('uri_scheme', 'private') ->setSetting('uri_scheme', 'private')
->setCardinality(-1) ->setCardinality(-1)
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true)
->setDisplayOptions('form', [ ->setDisplayOptions('form', [
'type' => 'file_generic', 'type' => 'file_generic',
'weight' => -1, 'weight' => -1,

View File

@ -9,15 +9,15 @@
* - link: A link to add a content entity of this type. * - link: A link to add a content entity of this type.
* - description: A description of this content entity types/bundle. * - 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 * @ingroup themeable
*/ */
#} #}
{% spaceless %} {% spaceless %}
<dl> <dl>
{% for type in types %} {% for id,type in bundles %}
<dt>{{ type.link }}</dt> <dt><a href="/opencase/oc_case/add/{{ id }}?client_id={{ client_id }}">{{ type.label }}</a></dt>
{% endfor %} {% endfor %}
</dl> </dl>
{% endspaceless %} {% endspaceless %}

View File

@ -60,6 +60,7 @@ function opencase_entities_theme() {
$theme['oc_activity_content_add_list'] = [ $theme['oc_activity_content_add_list'] = [
'render element' => 'content', 'render element' => 'content',
'variables' => ['content' => NULL], 'variables' => ['content' => NULL],
'template' => 'oc-activity-content-add-list',
'file' => 'oc_activity.page.inc', 'file' => 'oc_activity.page.inc',
]; ];
$theme['oc_organisation'] = [ $theme['oc_organisation'] = [

View File

@ -16,8 +16,8 @@
#} #}
{% spaceless %} {% spaceless %}
<dl> <dl>
{% for type in types %} {% for id,type in bundles %}
<dt>{{ type.link }}</dt> <dt><a href="/opencase/oc_activity/add/{{ id }}?case_id={{ case_id }}">{{ type.label }}</a></dt>
{% endfor %} {% endfor %}
</dl> </dl>
{% endspaceless %} {% endspaceless %}