diff --git a/modules/opencase_entities/opencase_entities.install b/modules/opencase_entities/opencase_entities.install index 3d7a8f5..b0513b4 100644 --- a/modules/opencase_entities/opencase_entities.install +++ b/modules/opencase_entities/opencase_entities.install @@ -4,6 +4,30 @@ use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter; use \Drupal\Core\Field\BaseFieldDefinition; +function opencase_entities_update_80200() { + $field_storage_definition = BaseFieldDefinition::create('string') + ->setLabel(t('Website')) + ->setRevisionable(TRUE) + ->setSettings([ + 'max_length' => 50, + 'text_processing' => 0, + ]) + ->setDefaultValue('') + ->setDisplayOptions('view', [ + 'label' => 'above', + 'type' => 'string', + 'weight' => 49, + ]) + ->setDisplayOptions('form', [ + 'type' => 'string_textfield', + 'weight' => 49, + ]) + ->setRequired(FALSE); + + \Drupal::entityDefinitionUpdateManager() + ->installFieldStorageDefinition('org_website', 'oc_organisation', 'opencase_entities', $field_storage_definition); +} + function opencase_entities_update_80199() { $field_storage_definition = BaseFieldDefinition::create('string') ->setLabel(t('Contact Role')) diff --git a/modules/opencase_entities/src/Entity/OCOrganisation.php b/modules/opencase_entities/src/Entity/OCOrganisation.php index df080a2..b805251 100644 --- a/modules/opencase_entities/src/Entity/OCOrganisation.php +++ b/modules/opencase_entities/src/Entity/OCOrganisation.php @@ -211,6 +211,24 @@ class OCOrganisation extends EditorialContentEntityBase implements OCOrganisatio 'type' => 'string_textarea', 'weight' => 50, )); + $fields['website'] = BaseFieldDefinition::create('string') + ->setLabel(t('Website')) + ->setRevisionable(TRUE) + ->setSettings([ + 'max_length' => 50, + 'text_processing' => 0, + ]) + ->setDefaultValue('') + ->setDisplayOptions('view', [ + 'label' => 'above', + 'type' => 'string', + 'weight' => 49, + ]) + ->setDisplayOptions('form', [ + 'type' => 'string_textfield', + 'weight' => 49, + ]) + ->setRequired(FALSE); $fields['contact_name'] = BaseFieldDefinition::create('string') ->setLabel(t('Contact Name')) ->setDescription(t('Name of the main contact for this organisation.')) diff --git a/opencase.info.yml b/opencase.info.yml index c713b1e..8e97f49 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.9 +version: 8.x-2.0.0 package: 'OpenCase' dependencies: - opencase_entities