ae3976c7b8
* Removed dependency of opencase_search on opencase so opencase_search doesn't get uninstalled when refreshing opencase for UI changes * Changed no-results wording on case views (both displays: all cases & cases for a person)
29 lines
893 B
Plaintext
29 lines
893 B
Plaintext
<?php
|
|
|
|
/**
|
|
* Add 'activity_date_time' field to 'oc_activity' entities.
|
|
*/
|
|
function opencase_entities_update_8003() {
|
|
$storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('datetime')
|
|
->setLabel(t('Date and time'))
|
|
->setDescription(t('When the activity started.'))
|
|
->setRevisionable(TRUE)
|
|
->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
|
|
->setDisplayOptions('view', [
|
|
'type' => 'datetime_default',
|
|
'settings' => [
|
|
'format_type' => 'medium',
|
|
],
|
|
'label' => 'above',
|
|
'weight' => -3,
|
|
])
|
|
->setDisplayOptions('form', [
|
|
'type' => 'datetime_default',
|
|
'weight' => -3,
|
|
]);
|
|
|
|
\Drupal::entityDefinitionUpdateManager()
|
|
->installFieldStorageDefinition('activity_date_time', 'oc_activity', 'oc_activity', $storage_definition);
|
|
}
|
|
|