From fc982f8376a6c24990565c1153903980f894fc71 Mon Sep 17 00:00:00 2001 From: naomi Date: Mon, 30 Apr 2018 12:59:07 +0200 Subject: [PATCH] Added actors field to case & and case to activity --- .../src/Entity/OCActivity.php | 19 +++++++++++++++++++ .../opencase_entities/src/Entity/OCCase.php | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/modules/opencase_entities/src/Entity/OCActivity.php b/modules/opencase_entities/src/Entity/OCActivity.php index 4c00b19..b126ca7 100644 --- a/modules/opencase_entities/src/Entity/OCActivity.php +++ b/modules/opencase_entities/src/Entity/OCActivity.php @@ -250,6 +250,25 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte ->setDisplayConfigurable('view', TRUE) ->setRequired(TRUE); + $fields['oc_case'] = 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) + ->setDisplayOptions('form', [ + 'type' => 'entity_reference_autocomplete', + 'weight' => 5, + 'settings' => [ + 'match_operator' => 'CONTAINS', + 'size' => '60', + 'autocomplete_type' => 'tags', + 'placeholder' => '', + ], + ]) + ->setRequired(TRUE); + $fields['status'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Publishing status')) ->setDescription(t('A boolean indicating whether the Activity is published.')) diff --git a/modules/opencase_entities/src/Entity/OCCase.php b/modules/opencase_entities/src/Entity/OCCase.php index 3cab1c5..688dd23 100644 --- a/modules/opencase_entities/src/Entity/OCCase.php +++ b/modules/opencase_entities/src/Entity/OCCase.php @@ -250,6 +250,25 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { ->setDisplayConfigurable('view', TRUE) ->setRequired(TRUE); + $fields['actors_involved'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('Involved Parties')) + ->setDescription(t('People involved in this case, in their various capacities')) + ->setSetting('target_type', 'oc_actor') + ->setSetting('handler', 'default') + ->setTranslatable(TRUE) + ->setCardinality(-1) + ->setDisplayOptions('form', [ + 'type' => 'entity_reference_autocomplete', + 'weight' => 5, + 'settings' => [ + 'match_operator' => 'CONTAINS', + 'size' => '60', + 'autocomplete_type' => 'tags', + 'placeholder' => '', + ], + ]) + ->setRequired(TRUE); + $fields['status'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Publishing status')) ->setDescription(t('A boolean indicating whether the Case is published.'))