From 0371c3778618ffe9b2bed63606d028f2a469dabb Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 10 Sep 2018 18:38:55 +0100 Subject: [PATCH] Added required tickbox, "consent to data storage" --- modules/opencase_entities/src/Entity/OCActor.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/opencase_entities/src/Entity/OCActor.php b/modules/opencase_entities/src/Entity/OCActor.php index 080de05..32b1620 100644 --- a/modules/opencase_entities/src/Entity/OCActor.php +++ b/modules/opencase_entities/src/Entity/OCActor.php @@ -290,14 +290,25 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface ->setDisplayOptions('view', [ 'label' => 'above', 'type' => 'string', - 'weight' => -1, + 'weight' => -2, ]) ->setDisplayOptions('form', [ 'type' => 'string_textfield', - 'weight' => -1, + 'weight' => -2, ]) ->setRequired(TRUE); + $fields['consent'] = BaseFieldDefinition::create('boolean') + ->setLabel(t('Consent to data storage')) + ->setDescription(t('Has this person explicitly consented to having their personal data stored on this system?')) + ->setRevisionable(TRUE) + ->setDefaultValue(FALSE) + ->setRequired(TRUE) + ->setDisplayOptions('form', array( + 'type' => 'checkbox', + 'weight' => -1, + )); + // Contact details. // so it is not exposed to user configuration. $fields['email'] = BaseFieldDefinition::create('string')