moved consent field to opencase_defaults and removed automatic "see all people" menu links

This commit is contained in:
Naomi
2020-11-20 11:00:52 +00:00
parent 7c5ee54a44
commit dfb12d9be6
5 changed files with 15 additions and 81 deletions

View File

@ -91,6 +91,20 @@ function opencase_defaults_block_access(\Drupal\block\Entity\Block $block, $oper
function opencase_defaults_entity_base_field_info($entity_type) {
$fields = array();
// Add consent field to person
if ($entity_type->id() === 'oc_actor') {
$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' => 'boolean_checkbox',
'weight' => -6,
));
}
// Add a Client field to cases
if ($entity_type->id() === 'oc_case') {
@ -117,7 +131,7 @@ function opencase_defaults_entity_base_field_info($entity_type) {
])
->setDefaultValueCallback('opencase_defaults_actors_involved_callback')
->setRequired(TRUE);
}
return $fields;
}