Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
ae3976c7b8 | |||
a7a96ab03c | |||
a6db6615df | |||
1c3370a784 | |||
59f4987371 | |||
c1e24593fa |
@ -4,6 +4,7 @@ dependencies:
|
|||||||
config:
|
config:
|
||||||
- user.role.authenticated
|
- user.role.authenticated
|
||||||
module:
|
module:
|
||||||
|
- datetime
|
||||||
- opencase_entities
|
- opencase_entities
|
||||||
- user
|
- user
|
||||||
id: activities
|
id: activities
|
||||||
@ -13,7 +14,6 @@ description: ''
|
|||||||
tag: ''
|
tag: ''
|
||||||
base_table: oc_activity_field_data
|
base_table: oc_activity_field_data
|
||||||
base_field: id
|
base_field: id
|
||||||
core: 8.x
|
|
||||||
display:
|
display:
|
||||||
default:
|
default:
|
||||||
display_plugin: default
|
display_plugin: default
|
||||||
@ -70,6 +70,72 @@ display:
|
|||||||
row:
|
row:
|
||||||
type: fields
|
type: fields
|
||||||
fields:
|
fields:
|
||||||
|
activity_date_time:
|
||||||
|
id: activity_date_time
|
||||||
|
table: oc_activity_field_data
|
||||||
|
field: activity_date_time
|
||||||
|
relationship: none
|
||||||
|
group_type: group
|
||||||
|
admin_label: ''
|
||||||
|
label: 'Date and time'
|
||||||
|
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: true
|
||||||
|
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: datetime_custom
|
||||||
|
settings:
|
||||||
|
timezone_override: ''
|
||||||
|
date_format: 'd/m/Y - H:i'
|
||||||
|
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
|
||||||
|
entity_type: oc_activity
|
||||||
|
entity_field: activity_date_time
|
||||||
|
plugin_id: field
|
||||||
name:
|
name:
|
||||||
id: name
|
id: name
|
||||||
table: oc_activity_field_data
|
table: oc_activity_field_data
|
||||||
@ -233,7 +299,7 @@ display:
|
|||||||
more_link_text: ''
|
more_link_text: ''
|
||||||
more_link_path: ''
|
more_link_path: ''
|
||||||
strip_tags: false
|
strip_tags: false
|
||||||
trim: true
|
trim: false
|
||||||
preserve_tags: ''
|
preserve_tags: ''
|
||||||
html: false
|
html: false
|
||||||
element_type: ''
|
element_type: ''
|
||||||
@ -264,73 +330,6 @@ display:
|
|||||||
entity_type: oc_activity
|
entity_type: oc_activity
|
||||||
entity_field: description
|
entity_field: description
|
||||||
plugin_id: field
|
plugin_id: field
|
||||||
created:
|
|
||||||
id: created
|
|
||||||
table: oc_activity_field_data
|
|
||||||
field: created
|
|
||||||
relationship: none
|
|
||||||
group_type: group
|
|
||||||
admin_label: ''
|
|
||||||
label: Created
|
|
||||||
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: true
|
|
||||||
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: timestamp
|
|
||||||
settings:
|
|
||||||
date_format: short
|
|
||||||
custom_date_format: ''
|
|
||||||
timezone: ''
|
|
||||||
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
|
|
||||||
entity_type: oc_activity
|
|
||||||
entity_field: created
|
|
||||||
plugin_id: field
|
|
||||||
view_oc_activity:
|
view_oc_activity:
|
||||||
id: view_oc_activity
|
id: view_oc_activity
|
||||||
table: oc_activity
|
table: oc_activity
|
||||||
|
@ -465,20 +465,7 @@ display:
|
|||||||
entity_field: created
|
entity_field: created
|
||||||
plugin_id: date
|
plugin_id: date
|
||||||
title: ''
|
title: ''
|
||||||
header:
|
header: { }
|
||||||
area:
|
|
||||||
id: area
|
|
||||||
table: views
|
|
||||||
field: area
|
|
||||||
relationship: none
|
|
||||||
group_type: group
|
|
||||||
admin_label: ''
|
|
||||||
empty: true
|
|
||||||
tokenize: false
|
|
||||||
content:
|
|
||||||
value: '<p>To <strong>add a new case</strong>, first search for the person you want to add it to. If the person is not on the system yet, you can add them using the "People" menu.</p>'
|
|
||||||
format: basic_html
|
|
||||||
plugin_id: text
|
|
||||||
footer: { }
|
footer: { }
|
||||||
empty:
|
empty:
|
||||||
area_text_custom:
|
area_text_custom:
|
||||||
@ -490,7 +477,7 @@ display:
|
|||||||
admin_label: ''
|
admin_label: ''
|
||||||
empty: true
|
empty: true
|
||||||
tokenize: false
|
tokenize: false
|
||||||
content: "<p>Either there are no cases involving this person, or you do not have access to them.</p>\n"
|
content: "<p>Either there are no cases involving this person, or you do not have access to them.</p> <p>To create a case, use the sidebar menu to the right</p>"
|
||||||
plugin_id: text_custom
|
plugin_id: text_custom
|
||||||
relationships: { }
|
relationships: { }
|
||||||
arguments:
|
arguments:
|
||||||
@ -597,7 +584,7 @@ display:
|
|||||||
admin_label: ''
|
admin_label: ''
|
||||||
empty: true
|
empty: true
|
||||||
tokenize: false
|
tokenize: false
|
||||||
content: "<h1>No cases found</h1>\n<p>You do not have access to any existing cases.</p>\n<p>To <b>add a new case</b>, first search for the person you want to add a case to. If they are not on the system yet you can add them using the <b>Add actors</b> menu in the left sidebar.</p>\n"
|
content: "<h1>No cases found</h1>\n<p>You do not have access to any existing cases.</p>\n<p>To <b>add a new case</b>, first search for the person you want to create a case for, using the search bar at the top right of the screen. If they are not on the system yet, add them using the <b>Add People</b> tab.</p>\n"
|
||||||
plugin_id: text_custom
|
plugin_id: text_custom
|
||||||
cache_metadata:
|
cache_metadata:
|
||||||
max-age: -1
|
max-age: -1
|
||||||
|
@ -41,3 +41,8 @@ body {
|
|||||||
.block-superfish .menu ul li a:hover {
|
.block-superfish .menu ul li a:hover {
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* In views, display label at top of field. Ths is because full descriptions are displayed in the activity view so having the label in the middle means it disappears down the page. */
|
||||||
|
td.views-field {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
@ -39,6 +39,13 @@ processor_configs:
|
|||||||
sort: 40
|
sort: 40
|
||||||
settings:
|
settings:
|
||||||
sort: ASC
|
sort: ASC
|
||||||
|
exclude_specified_items:
|
||||||
|
processor_id: exclude_specified_items
|
||||||
|
weights:
|
||||||
|
build: 50
|
||||||
|
settings:
|
||||||
|
exclude: client
|
||||||
|
regex: true
|
||||||
translate_entity:
|
translate_entity:
|
||||||
processor_id: translate_entity
|
processor_id: translate_entity
|
||||||
weights:
|
weights:
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
function opencase_default_reporting_uninstall() {
|
function opencase_default_reporting_uninstall() {
|
||||||
$configs = [
|
$configs = [
|
||||||
// 'search_api.index.opencase_reporting_cases',
|
'search_api.index.opencase_reporting_cases',
|
||||||
// 'search_api.index.opencase_reporting_clients',
|
'search_api.index.opencase_reporting_clients',
|
||||||
// 'search_api.index.opencase_reporting_volunteers',
|
'search_api.index.opencase_reporting_volunteers',
|
||||||
'block.block.facet_asylum_status',
|
'block.block.facet_asylum_status',
|
||||||
'block.block.facet_created',
|
'block.block.facet_created',
|
||||||
'block.block.facet_disability',
|
'block.block.facet_disability',
|
||||||
|
28
modules/opencase_entities/opencase_entities.install
Normal file
28
modules/opencase_entities/opencase_entities.install
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,8 @@ use Drupal\Core\Entity\RevisionableInterface;
|
|||||||
use Drupal\Core\Entity\EntityChangedTrait;
|
use Drupal\Core\Entity\EntityChangedTrait;
|
||||||
use Drupal\Core\Entity\EntityTypeInterface;
|
use Drupal\Core\Entity\EntityTypeInterface;
|
||||||
use Drupal\user\UserInterface;
|
use Drupal\user\UserInterface;
|
||||||
|
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
|
||||||
|
use Drupal\Core\Datetime\DrupalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the Activity entity.
|
* Defines the Activity entity.
|
||||||
@ -81,6 +83,12 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
|
|||||||
return array(\Drupal::request()->query->get('case_id'));
|
return array(\Drupal::request()->query->get('case_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function currentDateTime() {
|
||||||
|
$current_time = DrupalDateTime::createFromTimestamp(time());
|
||||||
|
$formatted = $current_time->format(DateTimeItem::DATETIME_STORAGE_FORMAT);
|
||||||
|
\Drupal::logger("nr_debug")->notice($formatted);
|
||||||
|
return $formatted;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@ -210,6 +218,25 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
|
|||||||
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
|
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
|
||||||
$fields = parent::baseFieldDefinitions($entity_type);
|
$fields = parent::baseFieldDefinitions($entity_type);
|
||||||
|
|
||||||
|
$fields['activity_date_time'] = BaseFieldDefinition::create('datetime')
|
||||||
|
->setLabel(t('Date and time'))
|
||||||
|
->setDescription('')
|
||||||
|
->setRevisionable(TRUE)
|
||||||
|
->setRequired(TRUE)
|
||||||
|
->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
|
||||||
|
->setDisplayOptions('view', [
|
||||||
|
'label' => 'above',
|
||||||
|
'type' => 'datetime_default',
|
||||||
|
'settings' => [
|
||||||
|
'format_type' => 'medium',
|
||||||
|
],
|
||||||
|
'weight' => -3,
|
||||||
|
])
|
||||||
|
->setDisplayOptions('form', [
|
||||||
|
'type' => 'datetime_default',
|
||||||
|
'weight' => -3,
|
||||||
|
]);
|
||||||
|
|
||||||
// not currently in use. Will set view and form settings when ready
|
// not currently in use. Will set view and form settings when ready
|
||||||
$fields['status'] = BaseFieldDefinition::create('boolean')
|
$fields['status'] = BaseFieldDefinition::create('boolean')
|
||||||
->setLabel(t('Publishing status'))
|
->setLabel(t('Publishing status'))
|
||||||
|
@ -6,4 +6,3 @@ package: 'OpenCase'
|
|||||||
dependencies:
|
dependencies:
|
||||||
- search_api
|
- search_api
|
||||||
- search_api_db
|
- search_api_db
|
||||||
- opencase
|
|
||||||
|
@ -2,6 +2,7 @@ name: 'OpenCase'
|
|||||||
type: module
|
type: module
|
||||||
description: 'Simple Case Management'
|
description: 'Simple Case Management'
|
||||||
core: 8.x
|
core: 8.x
|
||||||
|
version: 8.x-1.6
|
||||||
package: 'OpenCase'
|
package: 'OpenCase'
|
||||||
dependencies:
|
dependencies:
|
||||||
- opencase_entities
|
- opencase_entities
|
||||||
|
@ -138,6 +138,8 @@ function opencase_form_oc_case_type_edit_form_alter(&$form, $form_state) {
|
|||||||
function opencase_uninstall() {
|
function opencase_uninstall() {
|
||||||
$configs = [
|
$configs = [
|
||||||
'block.block.opencasecontextualmenu',
|
'block.block.opencasecontextualmenu',
|
||||||
|
'block.block.opencase',
|
||||||
|
'system.menu.opencase',
|
||||||
'views.view.cases',
|
'views.view.cases',
|
||||||
'views.view.activities'
|
'views.view.activities'
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user