Deleting activity in "No Cases" mode should redirect to first linked person, and other changes

This commit is contained in:
2021-02-05 13:43:11 +00:00
parent 06937b7443
commit 2bc1abc7a7
9 changed files with 437 additions and 24 deletions

View File

@ -118,7 +118,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
$name = $this->get('first_name')->value . ' ';
if ($this->get('middle_names')->value) $name .= $this->get('middle_names')->value . ' ';
$name .= $this->get('last_name')->value . ' ';
$name .= '(' . $this->bundle() . ')';
$name .= '(' . $this->type->entity->label() . ')';
$this->setName($name);
@ -284,7 +284,6 @@ 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'))
->setRevisionable(TRUE)
@ -293,6 +292,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
'max_length' => 30,
'text_processing' => 0,
))
->setDisplayConfigurable('form', true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
@ -387,6 +387,13 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setRevisionable(TRUE)
->setTranslatable(TRUE);
$fields['user_login'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Login Access'))
->setDescription(t('Whether this person should be able to log into the system.'))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('display', true)
->setDefaultValue(FALSE);
return $fields;
}