removed EVA stuff from template, plus misc

This commit is contained in:
naomi 2021-02-20 15:09:58 +00:00
parent 4647ef6e3e
commit 20cc8cd753
5 changed files with 30 additions and 20 deletions

View File

@ -0,0 +1,28 @@
langcode: en
status: true
dependencies:
config:
- views.view.equal_opps_records
module:
- system
- views
theme:
- bartik
id: exposedformequal_opps_recordspage_1
theme: bartik
region: content
weight: 0
provider: null
plugin: 'views_exposed_filter_block:equal_opps_records-page_1'
settings:
id: 'views_exposed_filter_block:equal_opps_records-page_1'
label: ''
provider: views
label_display: visible
views_label: 'Search by (whole) first or last name.'
visibility:
request_path:
id: request_path
pages: /equal-opps-records
negate: false
context_mapping: { }

View File

@ -23,15 +23,12 @@ function template_preprocess_oc_case(array &$variables) {
// Separate the fields into two sections to be displayed in two columns. // Separate the fields into two sections to be displayed in two columns.
// Remove the name (title) field as this is displayed anyway. // Remove the name (title) field as this is displayed anyway.
$variables['id'] = $variables['elements']['#oc_case']->get('id')[0]->get('value')->getValue(); $variables['id'] = $variables['elements']['#oc_case']->get('id')[0]->get('value')->getValue();
$variables['eva_fields'] = array(); // if the installation has any "EVA" (embedded view) fields this should catch them.
$variables['base_fields'] = array(); $variables['base_fields'] = array();
$variables['other_fields'] = array(); $variables['other_fields'] = array();
foreach (Element::children($variables['elements']) as $key) { foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key]; $variables['content'][$key] = $variables['elements'][$key];
if (in_array($key, ['created', 'changed', 'files', 'actors_involved', 'status', 'user_id'])) { if (in_array($key, ['created', 'changed', 'files', 'actors_involved', 'status', 'user_id'])) {
$variables['base_fields'][$key] = $variables['elements'][$key]; $variables['base_fields'][$key] = $variables['elements'][$key];
} else if (strpos($key, "entity_view") !== false) {
$variables['eva_fields'][$key] = $variables['elements'][$key];
} else { } else {
$variables['other_fields'][$key] = $variables['elements'][$key]; $variables['other_fields'][$key] = $variables['elements'][$key];
unset($variables['other_fields']['name']); unset($variables['other_fields']['name']);

View File

@ -29,10 +29,5 @@
{{ field }} {{ field }}
{% endfor %} {% endfor %}
</div> </div>
<div class="eva_fields">
{% for field in eva_fields %}
{{ field }}
{% endfor %}
</div>
</div> </div>
</div> </div>

View File

@ -149,13 +149,7 @@ class OCEvent extends ContentEntityBase implements OCEventInterface {
->setDescription(t('The user ID of author of the Event entity.')) ->setDescription(t('The user ID of author of the Event entity.'))
->setRevisionable(TRUE) ->setRevisionable(TRUE)
->setSetting('target_type', 'user') ->setSetting('target_type', 'user')
->setSetting('handler', 'default') ->setSetting('handler', 'default');
->setTranslatable(TRUE)
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'author',
'weight' => -4,
]);
$fields['name'] = BaseFieldDefinition::create('string') $fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name')) ->setLabel(t('Name'))
@ -165,11 +159,6 @@ class OCEvent extends ContentEntityBase implements OCEventInterface {
'text_processing' => 0, 'text_processing' => 0,
]) ])
->setDefaultValue('') ->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => -4,
])
->setDisplayOptions('form', [ ->setDisplayOptions('form', [
'type' => 'string_textfield', 'type' => 'string_textfield',
'weight' => -4, 'weight' => -4,

View File

@ -90,6 +90,7 @@ function opencase_uninstall() {
'system.menu.opencase', 'system.menu.opencase',
'views.view.contact_details_changes', 'views.view.contact_details_changes',
'views.view.equal_opps_records', 'views.view.equal_opps_records',
'block.block.exposedformequal_opps_recordspage_1',
]; ];
foreach($configs as $config) { foreach($configs as $config) {
Drupal::configFactory()->getEditable($config)->delete(); Drupal::configFactory()->getEditable($config)->delete();