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

View File

@ -290,14 +290,25 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setDisplayOptions('view', [ ->setDisplayOptions('view', [
'label' => 'above', 'label' => 'above',
'type' => 'string', 'type' => 'string',
'weight' => -1, 'weight' => -2,
]) ])
->setDisplayOptions('form', [ ->setDisplayOptions('form', [
'type' => 'string_textfield', 'type' => 'string_textfield',
'weight' => -1, 'weight' => -2,
]) ])
->setRequired(TRUE); ->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. // Contact details.
// so it is not exposed to user configuration. // so it is not exposed to user configuration.
$fields['email'] = BaseFieldDefinition::create('string') $fields['email'] = BaseFieldDefinition::create('string')