Added required tickbox, "consent to data storage"

This commit is contained in:
Naomi 2018-09-10 18:38:55 +01:00
parent e1e40bc8ad
commit 0371c37786
1 changed files with 13 additions and 2 deletions

View File

@ -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')