Commit c2938505 authored by kent@passingphase.nz's avatar kent@passingphase.nz

merge in fixes and improvements from github

parent e9497141
......@@ -5,14 +5,17 @@
"license": "GPL-2.0+",
"minimum-stability": "dev",
"prefer-stable": true,
"homepage": "https://www.drupal.org/project/message_private",
"homepage": "https://www.drupal.org/project/message_thread",
"require": {
"php": "^5.5|^7.0",
"drupal/core": "^8.6",
"drupal/message": "^1.0",
"drupal/message_history": "dev-1.x",
"drupal/message_notify": "^1.0",
"drupal/message_ui": "^1.0",
"drupal/message_private": "^1.0"
"drupal/message_private": "^1.0",
"drupal/message_thread_history": "1.0-alpha1",
"squizlabs/php_codesniffer": "*"
},
"require-dev": {
"composer/installers": "^1.2",
......
id: message_thread_delete_action
label: 'Delete selected message threads'
status: true
langcode: en
type: message_thread
plugin: message_thread_delete_action
dependencies:
module:
- message_thread
langcode: en
status: true
dependencies:
config:
- field.storage.message_thread.field_thread_participants
- field.storage.message_thread.field_thread_title
module:
- message_thread
id: message_thread_admin
label: 'Message Thread Admin'
module: views
description: ''
tag: ''
base_table: message_thread_field_data
base_field: thread_id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: none
options: { }
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 20
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: table
options:
grouping: { }
row_class: ''
default_row_class: true
override: true
sticky: false
caption: ''
summary: ''
description: ''
columns:
message_thread_bulk_form: message_thread_bulk_form
thread_id: thread_id
field_thread_title: field_thread_title
edit_message_thread: edit_message_thread
view_message_thread: view_message_thread
field_thread_participants: field_thread_participants
info:
message_thread_bulk_form:
align: ''
separator: ''
empty_column: false
responsive: ''
thread_id:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
field_thread_title:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
edit_message_thread:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
view_message_thread:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
field_thread_participants:
align: ''
separator: ''
empty_column: false
responsive: ''
default: '-1'
empty_table: false
row:
type: fields
fields:
message_thread_bulk_form:
id: message_thread_bulk_form
table: message_thread
field: message_thread_bulk_form
relationship: none
group_type: group
admin_label: ''
label: 'Message thread operations bulk form'
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
action_title: Action
include_exclude: exclude
selected_actions: { }
entity_type: message_thread
plugin_id: bulk_form
field_thread_title:
id: field_thread_title
table: message_thread__field_thread_title
field: field_thread_title
relationship: none
group_type: group
admin_label: ''
label: Title
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: 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
plugin_id: field
field_thread_participants:
id: field_thread_participants
table: message_thread__field_thread_participants
field: field_thread_participants
relationship: none
group_type: group
admin_label: ''
label: Participants
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: target_id
type: entity_reference_label
settings:
link: true
group_column: target_id
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
plugin_id: field
edit_message_thread:
id: edit_message_thread
table: message_thread
field: edit_message_thread
relationship: none
group_type: group
admin_label: ''
label: Edit
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
text: Edit
output_url_as_text: false
absolute: false
entity_type: message_thread
plugin_id: entity_link_edit
view_message_thread:
id: view_message_thread
table: message_thread
field: view_message_thread
relationship: none
group_type: group
admin_label: ''
label: View
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
text: View
output_url_as_text: false
absolute: false
entity_type: message_thread
plugin_id: entity_link
filters:
template:
id: template
table: message_thread_field_data
field: template
relationship: none
group_type: group
admin_label: ''
operator: in
value: { }
group: 1
exposed: true
expose:
operator_id: template_op
label: Template
description: ''
use_operator: false
operator: template_op
identifier: template
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
anonymous: '0'
replicator: '0'
self_service_editor: '0'
self_service_deployer: '0'
pfizer_rep: '0'
pfizer_admin: '0'
hcp: '0'
practice_manager: '0'
vml_admin: '0'
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: message_thread
entity_field: template
plugin_id: bundle
field_thread_title_value:
id: field_thread_title_value
table: message_thread__field_thread_title
field: field_thread_title_value
relationship: none
group_type: group
admin_label: ''
operator: contains
value: ''
group: 1
exposed: true
expose:
operator_id: field_thread_title_value_op
label: Title
description: ''
use_operator: false
operator: field_thread_title_value_op
identifier: title
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
anonymous: '0'
replicator: '0'
self_service_editor: '0'
self_service_deployer: '0'
pfizer_rep: '0'
pfizer_admin: '0'
hcp: '0'
practice_manager: '0'
vml_admin: '0'
placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: string
sorts: { }
title: 'Message Thread Admin'
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
tags:
- 'config:field.storage.message_thread.field_thread_participants'
- 'config:field.storage.message_thread.field_thread_title'
- extensions
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders: { }
path: admin/content/message-threads
menu:
type: tab
title: 'Message Threads'
description: ''
expanded: false
parent: system.admin_content
weight: 0
context: '0'
menu_name: admin
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
tags:
- 'config:field.storage.message_thread.field_thread_participants'
- 'config:field.storage.message_thread.field_thread_title'
- extensions
......@@ -7,3 +7,4 @@ configure: message_thread.admin_settings
dependencies:
- drupal:views
- message_private:message_private
- message_history:message_history
......@@ -2,9 +2,103 @@
/**
* @file
* Message Thread un-installer.
* Message Thread installer.
*/
use Drupal\Core\Database\Database;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Implements hook_install().
*/
function message_thread_install() {
// By default, maintain entity statistics for messages.
// @see \Drupal\message_thread\MessageStatisticsInterface
\Drupal::state()->set('message.maintain_entity_statistics', TRUE);
}
/**
* Implements hook_schema().
*/
function message_thread_schema() {
$schema['message_thread_statistics'] = [
'description' => 'Maintains statistics of message threads and messages to show "new" and "updated" flags.',
'fields' => [
'entity_id' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The entity_id of the entity for which the statistics are compiled.',
],
'entity_type' => [
'type' => 'varchar_ascii',
'not null' => TRUE,
'default' => 'message_thread',
'length' => EntityTypeInterface::ID_MAX_LENGTH,
'description' => 'The entity_type of the entity to which this message is a reply.',
],
'field_name' => [
'type' => 'varchar_ascii',
'not null' => TRUE,
'default' => '',
'length' => FieldStorageConfig::NAME_MAX_LENGTH,
'description' => 'The field_name of the field that was used to add this message.',
],
'mid' => [
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'The {message}.mid of the last message.',
],
'last_message_timestamp' => [
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'The Unix timestamp of the last message that was posted within this entity, from {message}.changed.',
],
'last_message_name' => [
'type' => 'varchar',
'length' => 60,
'not null' => FALSE,
'description' => 'The name of the latest author to post a message on this message thread, from {message}.name.',
],
'last_message_uid' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The user ID of the latest author to post a message on this message thread, from {message}.uid.',
],
'message_count' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The total number of messages on this entity.',
],
],
'primary key' => ['entity_id', 'entity_type', 'field_name'],
'indexes' => [
'last_message_timestamp' => ['last_message_timestamp'],
'message_count' => ['message_count'],
'last_message_uid' => ['last_message_uid'],
],
'foreign keys' => [
'last_message_author' => [
'table' => 'users',
'columns' => [
'last_message_uid' => 'uid',
],
],
],
];
return $schema;
}