diff --git a/configuration/views.view.eresources_records_export.yml b/configuration/views.view.eresources_records_export.yml index c14e375d..9f6cdb6d 100644 --- a/configuration/views.view.eresources_records_export.yml +++ b/configuration/views.view.eresources_records_export.yml @@ -1004,14 +1004,144 @@ display: multi_type: separator separator: ', ' field_api_classes: false + call_number_1: + id: call_number_1 + table: eresources_record + field: call_number + relationship: none + group_type: group + admin_label: '' + entity_type: eresources_record + entity_field: call_number + plugin_id: field + label: 'Call Number' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + catalogue_location_1: + id: catalogue_location_1 + table: eresources_record + field: catalogue_location + relationship: none + group_type: group + admin_label: '' + entity_type: eresources_record + entity_field: catalogue_location + plugin_id: field + label: 'Catalog Location' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false access_information__value: id: access_information__value - table: eresources_local_metadata + table: eresources_record field: access_information__value - relationship: local_metadata_id + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata + entity_type: eresources_record entity_field: access_information plugin_id: field label: 'Access Information' @@ -1070,12 +1200,12 @@ display: field_api_classes: false alternate_title: id: alternate_title - table: eresources_local_metadata + table: eresources_record field: alternate_title - relationship: local_metadata_id + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata + entity_type: eresources_record entity_field: alternate_title plugin_id: field label: 'Alternate Title' @@ -1135,12 +1265,12 @@ display: field_api_classes: false date_coverage: id: date_coverage - table: eresources_local_metadata + table: eresources_record field: date_coverage - relationship: local_metadata_id + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata + entity_type: eresources_record entity_field: date_coverage plugin_id: field label: 'Coverage/Publication Date' @@ -1200,12 +1330,12 @@ display: field_api_classes: false description__value: id: description__value - table: eresources_local_metadata + table: eresources_record field: description__value - relationship: local_metadata_id + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata + entity_type: eresources_record entity_field: description plugin_id: field label: Description @@ -1264,12 +1394,12 @@ display: field_api_classes: false is_collection: id: is_collection - table: eresources_local_metadata + table: eresources_record field: is_collection - relationship: local_metadata_id + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata + entity_type: eresources_record entity_field: is_collection plugin_id: field label: 'Is a Collection' @@ -1331,12 +1461,12 @@ display: field_api_classes: false license_status: id: license_status - table: eresources_local_metadata + table: eresources_record field: license_status - relationship: local_metadata_id + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata + entity_type: eresources_record entity_field: license_status plugin_id: field label: 'License Status' @@ -1393,17 +1523,17 @@ display: multi_type: separator separator: ', ' field_api_classes: false - subscription_end_date: - id: subscription_end_date - table: eresources_local_metadata - field: subscription_end_date - relationship: local_metadata_id + subscription_start_date_1: + id: subscription_start_date_1 + table: eresources_record + field: subscription_start_date + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata - entity_field: subscription_end_date + entity_type: eresources_record + entity_field: subscription_start_date plugin_id: field - label: 'Subscription End Date' + label: 'Subscription Start Date' exclude: false alter: alter_text: false @@ -1459,17 +1589,17 @@ display: multi_type: separator separator: ', ' field_api_classes: false - subscription_start_date: - id: subscription_start_date - table: eresources_local_metadata - field: subscription_start_date - relationship: local_metadata_id + subscription_end_date_1: + id: subscription_end_date_1 + table: eresources_record + field: subscription_end_date + relationship: none group_type: group admin_label: '' - entity_type: eresources_local_metadata - entity_field: subscription_start_date + entity_type: eresources_record + entity_field: subscription_end_date plugin_id: field - label: 'Subscription Start Date' + label: 'Subscription End Date' exclude: false alter: alter_text: false @@ -1654,18 +1784,7 @@ display: distinct: false replica: false query_tags: { } - relationships: - local_metadata_id: - id: local_metadata_id - table: eresources_record - field: local_metadata_id - relationship: none - group_type: group - admin_label: 'eResources Local Metadata' - entity_type: eresources_record - entity_field: local_metadata_id - plugin_id: standard - required: true + relationships: { } header: { } footer: { } display_extenders: { } diff --git a/custom/modules/eresources/eresources.permissions.yml b/custom/modules/eresources/eresources.permissions.yml index 6d97a4b7..0dc329f9 100644 --- a/custom/modules/eresources/eresources.permissions.yml +++ b/custom/modules/eresources/eresources.permissions.yml @@ -35,22 +35,3 @@ update eresources_record entities: delete eresources_record entities: title: "Delete e-Resources Records." - -# Local Metadata entities -administer eresources_local_metadata entities: - title: "Administer e-Resources Local Metadata." - -list eresources_local_metadata entities: - title: "List e-Resources Local Metadata." - -create eresources_local_metadata entities: - title: "Create e-Resources Local Metadata." - -view eresources_local_metadata entities: - title: "View e-Resources Local Metadata." - -update eresources_local_metadata entities: - title: "Edit e-Resources Local Metadata." - -delete eresources_local_metadata entities: - title: "Delete e-Resources Local Metadata." diff --git a/custom/modules/eresources/src/Entity/LocalMetadata.php b/custom/modules/eresources/src/Entity/LocalMetadata.php deleted file mode 100644 index 432c74aa..00000000 --- a/custom/modules/eresources/src/Entity/LocalMetadata.php +++ /dev/null @@ -1,202 +0,0 @@ -setLabel(t('Alternate Title')) - ->setRequired(FALSE) - ->setSettings( - [ - 'default_value' => '', - 'max_length' => 255, - ] - ) - ->setDisplayOptions('form', [ - 'type' => 'string_textfield', - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['date_coverage'] = BaseFieldDefinition::create('string') - ->setLabel(t('Coverage/Publication Date')) - ->setRequired(FALSE) - ->setSettings( - [ - 'default_value' => '', - 'max_length' => 255, - ] - ) - ->setDisplayOptions('form', [ - 'type' => 'string_textfield', - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['subscription_start_date'] = BaseFieldDefinition::create('datetime') - ->setLabel(t('Subscription Start Date')) - ->setRequired(FALSE) - ->setSettings([ - 'datetime_type' => 'date', - ]) - ->setDisplayOptions('form', [ - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['subscription_end_date'] = BaseFieldDefinition::create('datetime') - ->setLabel(t('Subscription End Date')) - ->setRequired(FALSE) - ->setSettings([ - 'datetime_type' => 'date', - ]) - ->setDisplayOptions('form', [ - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['description'] = BaseFieldDefinition::create('text_long') - ->setLabel(t('Description')) - ->setRequired(FALSE) - ->setSettings([ - 'max_length' => 4096, - ]) - ->setDisplayOptions('form', [ - 'type' => 'text_textarea', - 'rows' => 6, - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['access_information'] = BaseFieldDefinition::create('text_long') - ->setLabel(t('Access Information')) - ->setRequired(FALSE) - ->setSettings([ - 'max_length' => 4096, - ]) - ->setDisplayOptions('form', [ - 'type' => 'text_textarea', - 'rows' => 6, - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['license_status'] = BaseFieldDefinition::create('list_string') - ->setLabel(t('License Status')) - ->setRequired(FALSE) - ->setSettings([ - 'allowed_values' => [ - 'Y' => 'Licensed', - 'OA' => 'Free / Open Access', - 'T' => 'Trial', - 'C' => 'Cancelled', - ], - ]) - ->setDisplayOptions('form', [ - 'type' => 'options_select', - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['catalogue_location'] = BaseFieldDefinition::create('string') - ->setLabel(t('Catalog Location')) - ->setRequired(FALSE) - ->setSettings( - [ - 'default_value' => '', - 'max_length' => 255, - ] - ) - ->setDisplayOptions('form', [ - 'type' => 'string_textfield', - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['call_number'] = BaseFieldDefinition::create('string') - ->setLabel(t('Call Number')) - ->setRequired(FALSE) - ->setSettings( - [ - 'default_value' => '', - 'max_length' => 255, - ] - ) - ->setDisplayOptions('form', [ - 'type' => 'string_textfield', - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - $fields['is_collection'] = BaseFieldDefinition::create('boolean') - ->setLabel(t('Is a Collection')) - ->setRequired(FALSE) - ->setDefaultValue(FALSE) - ->setDisplayOptions('form', [ - 'type' => 'boolean_checkbox', - 'weight' => 0, - ]) - ->setDisplayConfigurable('form', TRUE); - - return $fields; - } - - /** - * {@inheritDoc} - */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - parent::postSave($storage, $update); - $records = $this->entityTypeManager()->getStorage('eresources_record')->loadByProperties([ - 'local_metadata_id' => $this->id(), - ]); - if (!empty($records)) { - $record = end($records); - $record->save(); - } - } - -} diff --git a/custom/modules/eresources/src/Entity/OclcMetadata.php b/custom/modules/eresources/src/Entity/OclcMetadata.php deleted file mode 100644 index 6004251c..00000000 --- a/custom/modules/eresources/src/Entity/OclcMetadata.php +++ /dev/null @@ -1,53 +0,0 @@ -setLabel(t('Description')) - ->setRequired(FALSE) - ->setSettings([ - 'max_length' => 4096, - ]); - - return $fields; - } - -} diff --git a/custom/modules/eresources/src/Entity/Record.php b/custom/modules/eresources/src/Entity/Record.php index b840263b..f72f23e4 100644 --- a/custom/modules/eresources/src/Entity/Record.php +++ b/custom/modules/eresources/src/Entity/Record.php @@ -57,16 +57,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setSetting('target_type', 'eresources_harvested_collection') ->setSetting('handler', 'default'); - $fields['local_metadata_id'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Local Metadata ID')) - ->setSetting('target_type', 'eresources_local_metadata') - ->setSetting('handler', 'default'); - - $fields['oclc_metadata_id'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('OCLC Metadata ID')) - ->setSetting('target_type', 'eresources_oclc_metadata') - ->setSetting('handler', 'default'); - $fields['entry_uid'] = BaseFieldDefinition::create('string') ->setLabel(t('OCLC Entry UID')) ->setDescription(t('Used for Knowledge Base synchronization.')) diff --git a/custom/modules/eresources/templates/eresources-record.html.twig b/custom/modules/eresources/templates/eresources-record.html.twig index 88bf9fb4..37483ece 100644 --- a/custom/modules/eresources/templates/eresources-record.html.twig +++ b/custom/modules/eresources/templates/eresources-record.html.twig @@ -12,8 +12,7 @@ {{ fieldObj.name }}{{ fieldObj.value }} {% endfor %} -{% set local_metadata = eresources_record.local_metadata_id.entity %} -

Local Metadata (edit)

+

Local Metadata

{% set fields = [ @@ -22,21 +21,18 @@ 'license_status', 'is_collection', ] %} {% for field in fields %} - {% set fieldObj = local_metadata.get(field) %} + {% set fieldObj = eresources_record.get(field) %} {% endfor %}
KeyValue
{{ fieldObj.name }}{{ fieldObj.value }}
-{% if eresources_record.oclc_metadata_id is not empty %} -{% set oclc_metadata = eresources_record.oclc_metadata_id.entity %}

OCLC Metadata

{% set fields = [ - 'description', + 'oclc_description', ] %} {% for field in fields %} - {% set fieldObj = oclc_metadata.get(field) %} + {% set fieldObj = eresources_record.get(field) %} {% endfor %}
KeyValue
{{ fieldObj.name }}{{ fieldObj.value }}
-{% endif %}