Skip to content

Commit

Permalink
Merge branch 'master' of github.com:drupal-ukraine/dcamp-site
Browse files Browse the repository at this point in the history
  • Loading branch information
anpolimus committed May 24, 2019
2 parents 4279202 + 981166c commit 3813242
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ label: Status
description: ''
required: false
translatable: false
default_value: { }
default_value:
-
value: '0'
default_value_callback: ''
settings: { }
field_type: list_string
110 changes: 55 additions & 55 deletions config/sync/views.view.attenders_overview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- commerce_order
- options
- paragraphs
- state_machine
id: attenders_overview
label: 'Attenders overview'
module: views
Expand Down Expand Up @@ -181,7 +182,7 @@ display:
alter_text: true
text: '{{ order_id }}-{{ delta }}'
make_link: true
path: 'admin/commerce/orders/{{ order_id }} '
path: 'admin/commerce/orders/{{ order_id }}'
absolute: false
external: false
replace_spaces: false
Expand Down Expand Up @@ -391,6 +392,46 @@ display:
entity_type: commerce_order_item
entity_field: type
plugin_id: commerce_entity_bundle
state:
id: state
table: commerce_order
field: state
relationship: order_id
group_type: group
admin_label: ''
operator: in
value:
completed: completed
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
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: commerce_order
entity_field: state
plugin_id: state_machine_state
sorts: { }
header: { }
footer:
Expand Down Expand Up @@ -473,10 +514,10 @@ display:
display_options:
display_extenders: { }
arguments:
field_attended_value:
id: field_attended_value
table: paragraph__field_attended
field: field_attended_value
field_attendee_status_value:
id: field_attendee_status_value
table: paragraph__field_attendee_status
field: field_attendee_status_value
relationship: field_attendee
group_type: group
admin_label: ''
Expand All @@ -501,14 +542,19 @@ display:
sort_order: asc
number_of_records: 0
format: default_summary
human: false
specify_validation: false
validate:
type: none
fail: 'not found'
validate_options: { }
glossary: false
limit: 0
case: none
path_case: none
transform_dash: false
break_phrase: false
not: false
plugin_id: numeric
plugin_id: string_list_field
defaults:
arguments: false
display_description: ''
Expand Down Expand Up @@ -598,8 +644,8 @@ display:
defaults:
arguments: false
fields: false
filters: false
filter_groups: false
filters: true
filter_groups: true
fields:
order_id:
id: order_id
Expand Down Expand Up @@ -779,52 +825,6 @@ display:
separator: ', '
field_api_classes: false
plugin_id: field
filters:
type:
id: type
table: commerce_order_item
field: type
relationship: none
group_type: group
admin_label: ''
operator: in
value:
drupal_camp_ticket: drupal_camp_ticket
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
hide_single_bundle: true
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: commerce_order_item
entity_field: type
plugin_id: commerce_entity_bundle
filter_groups:
operator: AND
groups:
1: AND
cache_metadata:
max-age: -1
contexts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,19 @@ public function tshirtsReport() {
* The reports build array.
*/
public function attendeesReport() {
$keys = ['1', '0'];
$field_name = 'field_attendee_status';
$bundle_fields = $this->entityFieldManager->getFieldDefinitions('paragraph', 'attendee');
if (empty($bundle_fields[$field_name])
|| empty($bundle_fields[$field_name]->getSetting('allowed_values'))) {
return ['#markup' => 'No attendees in this list'];
}
$build = [];
$allowed_values = $bundle_fields[$field_name]->getSetting('allowed_values');


$total = 0;

foreach ($keys as $key) {
foreach ($allowed_values as $key => $value) {
$args = [$key];
$view = Views::getView('attenders_overview');
$view->setArguments($args);
Expand All @@ -150,7 +158,7 @@ public function attendeesReport() {
$build['report_' . $key] = [
'#type' => 'details',
'#title' => $this->t('@title: @count', [
'@title' => $key ? $this->t('Attended') : $this->t('Not Attended'),
'@title' => $value,
'@count' => $count,
]),
'#open' => FALSE,
Expand Down

0 comments on commit 3813242

Please sign in to comment.