Chris@0: t('Users who have created accounts on your site.'); Chris@0: $data['users_field_data']['table']['base']['access query tag'] = 'user_access'; Chris@0: Chris@0: $data['users_field_data']['table']['wizard_id'] = 'user'; Chris@0: Chris@0: $data['users_field_data']['uid']['argument']['id'] = 'user_uid'; Chris@0: $data['users_field_data']['uid']['argument'] += [ Chris@0: 'name table' => 'users_field_data', Chris@0: 'name field' => 'name', Chris@0: 'empty field name' => \Drupal::config('user.settings')->get('anonymous'), Chris@0: ]; Chris@0: $data['users_field_data']['uid']['filter']['id'] = 'user_name'; Chris@0: $data['users_field_data']['uid']['filter']['title'] = $this->t('Name (autocomplete)'); Chris@0: $data['users_field_data']['uid']['filter']['help'] = $this->t('The user or author name. Uses an autocomplete widget to find a user name, the actual filter uses the resulting user ID.'); Chris@0: $data['users_field_data']['uid']['relationship'] = [ Chris@0: 'title' => $this->t('Content authored'), Chris@0: 'help' => $this->t('Relate content to the user who created it. This relationship will create one record for each content item created by the user.'), Chris@0: 'id' => 'standard', Chris@0: 'base' => 'node_field_data', Chris@0: 'base field' => 'uid', Chris@0: 'field' => 'uid', Chris@0: 'label' => $this->t('nodes'), Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['uid_raw'] = [ Chris@0: 'help' => $this->t('The raw numeric user ID.'), Chris@0: 'real field' => 'uid', Chris@0: 'filter' => [ Chris@0: 'title' => $this->t('The user ID'), Chris@0: 'id' => 'numeric', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['uid_representative'] = [ Chris@0: 'relationship' => [ Chris@0: 'title' => $this->t('Representative node'), Chris@0: 'label' => $this->t('Representative node'), Chris@0: 'help' => $this->t('Obtains a single representative node for each user, according to a chosen sort criterion.'), Chris@0: 'id' => 'groupwise_max', Chris@0: 'relationship field' => 'uid', Chris@0: 'outer field' => 'users_field_data.uid', Chris@0: 'argument table' => 'users_field_data', Chris@0: 'argument field' => 'uid', Chris@0: 'base' => 'node_field_data', Chris@0: 'field' => 'nid', Chris@17: 'relationship' => 'node_field_data:uid', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users']['uid_current'] = [ Chris@0: 'real field' => 'uid', Chris@0: 'title' => $this->t('Current'), Chris@0: 'help' => $this->t('Filter the view to the currently logged in user.'), Chris@0: 'filter' => [ Chris@0: 'id' => 'user_current', Chris@0: 'type' => 'yes-no', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['name']['help'] = $this->t('The user or author name.'); Chris@0: $data['users_field_data']['name']['field']['default_formatter'] = 'user_name'; Chris@0: $data['users_field_data']['name']['filter']['title'] = $this->t('Name (raw)'); Chris@0: $data['users_field_data']['name']['filter']['help'] = $this->t('The user or author name. This filter does not check if the user exists and allows partial matching. Does not use autocomplete.'); Chris@0: Chris@0: // Note that this field implements field level access control. Chris@0: $data['users_field_data']['mail']['help'] = $this->t('Email address for a given user. This field is normally not shown to users, so be cautious when using it.'); Chris@0: Chris@0: $data['users_field_data']['langcode']['help'] = $this->t('Original language of the user information'); Chris@0: $data['users_field_data']['langcode']['help'] = $this->t('Language of the translation of user information'); Chris@0: Chris@0: $data['users_field_data']['preferred_langcode']['title'] = $this->t('Preferred language'); Chris@0: $data['users_field_data']['preferred_langcode']['help'] = $this->t('Preferred language of the user'); Chris@0: $data['users_field_data']['preferred_admin_langcode']['title'] = $this->t('Preferred admin language'); Chris@0: $data['users_field_data']['preferred_admin_langcode']['help'] = $this->t('Preferred administrative language of the user'); Chris@0: Chris@0: $data['users_field_data']['created_fulldate'] = [ Chris@0: 'title' => $this->t('Created date'), Chris@0: 'help' => $this->t('Date in the form of CCYYMMDD.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'created', Chris@0: 'id' => 'date_fulldate', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['created_year_month'] = [ Chris@0: 'title' => $this->t('Created year + month'), Chris@0: 'help' => $this->t('Date in the form of YYYYMM.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'created', Chris@0: 'id' => 'date_year_month', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['created_year'] = [ Chris@0: 'title' => $this->t('Created year'), Chris@0: 'help' => $this->t('Date in the form of YYYY.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'created', Chris@0: 'id' => 'date_year', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['created_month'] = [ Chris@0: 'title' => $this->t('Created month'), Chris@0: 'help' => $this->t('Date in the form of MM (01 - 12).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'created', Chris@0: 'id' => 'date_month', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['created_day'] = [ Chris@0: 'title' => $this->t('Created day'), Chris@0: 'help' => $this->t('Date in the form of DD (01 - 31).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'created', Chris@0: 'id' => 'date_day', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['created_week'] = [ Chris@0: 'title' => $this->t('Created week'), Chris@0: 'help' => $this->t('Date in the form of WW (01 - 53).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'created', Chris@0: 'id' => 'date_week', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['status']['filter']['label'] = $this->t('Active'); Chris@0: $data['users_field_data']['status']['filter']['type'] = 'yes-no'; Chris@0: Chris@0: $data['users_field_data']['changed']['title'] = $this->t('Updated date'); Chris@0: Chris@0: $data['users_field_data']['changed_fulldate'] = [ Chris@0: 'title' => $this->t('Updated date'), Chris@0: 'help' => $this->t('Date in the form of CCYYMMDD.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_fulldate', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['changed_year_month'] = [ Chris@0: 'title' => $this->t('Updated year + month'), Chris@0: 'help' => $this->t('Date in the form of YYYYMM.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_year_month', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['changed_year'] = [ Chris@0: 'title' => $this->t('Updated year'), Chris@0: 'help' => $this->t('Date in the form of YYYY.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_year', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['changed_month'] = [ Chris@0: 'title' => $this->t('Updated month'), Chris@0: 'help' => $this->t('Date in the form of MM (01 - 12).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_month', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['changed_day'] = [ Chris@0: 'title' => $this->t('Updated day'), Chris@0: 'help' => $this->t('Date in the form of DD (01 - 31).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_day', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users_field_data']['changed_week'] = [ Chris@0: 'title' => $this->t('Updated week'), Chris@0: 'help' => $this->t('Date in the form of WW (01 - 53).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_week', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users']['data'] = [ Chris@0: 'title' => $this->t('Data'), Chris@0: 'help' => $this->t('Provides access to the user data service.'), Chris@0: 'real field' => 'uid', Chris@0: 'field' => [ Chris@0: 'id' => 'user_data', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['users']['user_bulk_form'] = [ Chris@0: 'title' => $this->t('Bulk update'), Chris@0: 'help' => $this->t('Add a form element that lets you run operations on multiple users.'), Chris@0: 'field' => [ Chris@0: 'id' => 'user_bulk_form', Chris@0: ], Chris@0: ]; Chris@0: Chris@14: // Alter the user roles target_id column. Chris@14: $data['user__roles']['roles_target_id']['field']['id'] = 'user_roles'; Chris@14: $data['user__roles']['roles_target_id']['field']['no group by'] = TRUE; Chris@0: Chris@14: $data['user__roles']['roles_target_id']['filter']['id'] = 'user_roles'; Chris@14: $data['user__roles']['roles_target_id']['filter']['allow empty'] = TRUE; Chris@0: Chris@14: $data['user__roles']['roles_target_id']['argument'] = [ Chris@14: 'id' => 'user__roles_rid', Chris@14: 'name table' => 'role', Chris@14: 'name field' => 'name', Chris@14: 'empty field name' => $this->t('No role'), Chris@14: 'zero is null' => TRUE, Chris@14: 'numeric' => TRUE, Chris@0: ]; Chris@0: Chris@0: $data['user__roles']['permission'] = [ Chris@0: 'title' => $this->t('Permission'), Chris@0: 'help' => $this->t('The user permissions.'), Chris@0: 'field' => [ Chris@0: 'id' => 'user_permissions', Chris@0: 'no group by' => TRUE, Chris@0: ], Chris@0: 'filter' => [ Chris@0: 'id' => 'user_permissions', Chris@0: 'real field' => 'roles_target_id', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: return $data; Chris@0: } Chris@0: Chris@0: }