diff --git a/modules/opencase_entities/opencase_entities.install b/modules/opencase_entities/opencase_entities.install index a5f558a..3d7a8f5 100644 --- a/modules/opencase_entities/opencase_entities.install +++ b/modules/opencase_entities/opencase_entities.install @@ -2,6 +2,31 @@ use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter; +use \Drupal\Core\Field\BaseFieldDefinition; + +function opencase_entities_update_80199() { + $field_storage_definition = BaseFieldDefinition::create('string') + ->setLabel(t('Contact Role')) + ->setDescription(t('Role of the contact within the organisation')) + ->setRevisionable(TRUE) + ->setSettings([ + 'max_length' => 50, + 'text_processing' => 0, + ]) + ->setDefaultValue('') + ->setDisplayOptions('view', [ + 'label' => 'above', + 'type' => 'string', + 'weight' => 52, + ]) + ->setDisplayOptions('form', [ + 'type' => 'string_textfield', + 'weight' => 52, + ]) + ->setRequired(FALSE); + \Drupal::entityDefinitionUpdateManager() + ->installFieldStorageDefinition('contact_role', 'oc_organisation', 'opencase_entities', $field_storage_definition); +} function opencase_entities_update_80198() { $field_storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('file') diff --git a/modules/opencase_entities/src/Entity/OCOrganisation.php b/modules/opencase_entities/src/Entity/OCOrganisation.php index c9c5df4..df080a2 100644 --- a/modules/opencase_entities/src/Entity/OCOrganisation.php +++ b/modules/opencase_entities/src/Entity/OCOrganisation.php @@ -213,7 +213,7 @@ class OCOrganisation extends EditorialContentEntityBase implements OCOrganisatio )); $fields['contact_name'] = BaseFieldDefinition::create('string') ->setLabel(t('Contact Name')) - ->setDescription(t('Name of the main contact for this client.')) + ->setDescription(t('Name of the main contact for this organisation.')) ->setRevisionable(TRUE) ->setSettings([ 'max_length' => 50, @@ -231,6 +231,25 @@ class OCOrganisation extends EditorialContentEntityBase implements OCOrganisatio ]) ->setRequired(FALSE); + $fields['contact_role'] = BaseFieldDefinition::create('string') + ->setLabel(t('Contact Role')) + ->setDescription(t('Role of the contact within the organisation')) + ->setRevisionable(TRUE) + ->setSettings([ + 'max_length' => 50, + 'text_processing' => 0, + ]) + ->setDefaultValue('') + ->setDisplayOptions('view', [ + 'label' => 'above', + 'type' => 'string', + 'weight' => 52, + ]) + ->setDisplayOptions('form', [ + 'type' => 'string_textfield', + 'weight' => 52, + ]) + ->setRequired(FALSE); $fields['email'] = BaseFieldDefinition::create('string') ->setLabel(t('Email Address')) ->setRevisionable(TRUE) diff --git a/opencase.info.yml b/opencase.info.yml index 04c5c9c..c713b1e 100644 --- a/opencase.info.yml +++ b/opencase.info.yml @@ -2,7 +2,7 @@ name: 'OpenCase' type: module description: 'Simple Case Management' core: 8.x -version: 8.x-1.9.8 +version: 8.x-1.9.9 package: 'OpenCase' dependencies: - opencase_entities