Added contact details to actor

This commit is contained in:
naomi 2018-05-08 20:44:08 +02:00
parent e2f77bf301
commit d8aaacec2d
2 changed files with 92 additions and 1 deletions

View File

@ -33,7 +33,8 @@ delete all client revisions:
description: 'Role requires permission to <em>view Client revisions</em> and <em>delete rights</em> for client entities in question or <em>administer client entities</em>.'
view volunteer involvement in cases:
title: 'View Volunteer Involvement in Cases (see their name, but nothing else)'
title: 'View names of Volunteers involved in Cases'
description: 'This role can be given to a user who does not have permission to view volunteers, so that they can see the names of volunteers involved in the cases that they can see.'
add volunteer entities:
title: 'Create new Volunteer entities'

View File

@ -298,6 +298,96 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
])
->setRequired(TRUE);
// Contact details.
// so it is not exposed to user configuration.
$fields['email'] = BaseFieldDefinition::create('string')
->setLabel(t('Email Address'))
->setSettings(array(
'default_value' => '',
'max_length' => 30,
'text_processing' => 0,
))
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => 0,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => 0,
));
$fields['phone'] = BaseFieldDefinition::create('string')
->setLabel(t('Main Phone Number'))
->setDisplayConfigurable('view', TRUE)
->setDisplayConfigurable('form', TRUE)
->setSettings(array(
'default_value' => '',
'max_length' => 20,
'text_processing' => 0,
))
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => 2,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => 2,
));
$fields['phone2'] = BaseFieldDefinition::create('string')
->setLabel(t('Alternative Phone Number'))
->setSettings(array(
'default_value' => '',
'max_length' => 20,
'text_processing' => 0,
))
->setDisplayConfigurable('view', TRUE)
->setDisplayConfigurable('form', TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => 3,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => 3,
));
$fields['postal_address'] = BaseFieldDefinition::create('string_long')
->setLabel(t('Postal Address'))
->setDescription(t('Full address, apart from post code.'))
->setDisplayConfigurable('view', TRUE)
->setDisplayConfigurable('form', TRUE)
->setSettings(array(
'default_value' => '',
'max_length' => 255,
'text_processing' => 0,
))
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'text',
'weight' => 5,
))
->setDisplayOptions('form', array(
'type' => 'string_textarea',
'weight' => 5,
));
$fields['post_code'] = BaseFieldDefinition::create('string')
->setLabel(t('Post Code'))
->setSettings(array(
'default_value' => '',
'max_length' => 10,
'text_processing' => 0,
))
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => 6,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => 6,
));
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))
->setDescription(t('The time that the entity was created.'));