Changed max length of full name, and some other things
This commit is contained in:
@ -34,7 +34,7 @@ function template_preprocess_oc_activity(array &$variables) {
|
||||
$variables['other_fields'] = array();
|
||||
foreach (Element::children($variables['elements']) as $key) {
|
||||
$variables['content'][$key] = $variables['elements'][$key];
|
||||
if (in_array($key, ['activity_date_time', 'time_taken', 'description', 'user_id'])) {
|
||||
if (in_array($key, ['activity_date_time', 'time_taken', 'description', 'user_id', 'actors_involved'])) {
|
||||
$variables['base_fields'][$key] = $variables['elements'][$key];
|
||||
} else {
|
||||
$variables['other_fields'][$key] = $variables['elements'][$key];
|
||||
|
@ -85,7 +85,8 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
|
||||
|
||||
public static function currentDateTime() {
|
||||
$current_time = DrupalDateTime::createFromTimestamp(time());
|
||||
$formatted = $current_time->format(DateTimeItem::DATETIME_STORAGE_FORMAT);
|
||||
$formatted = $current_time->format('Y-m-d');
|
||||
error_log($formatted);
|
||||
return $formatted;
|
||||
}
|
||||
/**
|
||||
@ -222,11 +223,16 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
|
||||
->setRevisionable(TRUE)
|
||||
->setRequired(TRUE)
|
||||
->setDefaultValueCallback('\Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true)
|
||||
->setSettings([
|
||||
'datetime_type' => 'date'
|
||||
])
|
||||
->setDisplayOptions('view', [
|
||||
'label' => 'above',
|
||||
'type' => 'datetime_default',
|
||||
'settings' => [
|
||||
'format_type' => 'medium',
|
||||
'format_type' => 'short',
|
||||
],
|
||||
'weight' => -3,
|
||||
])
|
||||
|
@ -248,7 +248,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
|
||||
->setLabel(t('Name'))
|
||||
->setRevisionable(TRUE)
|
||||
->setSettings([
|
||||
'max_length' => 20,
|
||||
'max_length' => 50,
|
||||
'text_processing' => 0,
|
||||
])
|
||||
->setDisplayConfigurable("form", true)
|
||||
|
@ -19,6 +19,7 @@
|
||||
<h2>{{ title }}</h2>
|
||||
<div class="oc_entity">
|
||||
<div class="left">
|
||||
{{ base_fields.actors_involved }}
|
||||
{{ base_fields.activity_date_time }}
|
||||
{{ base_fields.description }}
|
||||
{{ base_fields.time_taken }}
|
||||
|
Reference in New Issue
Block a user