Great module.
I cloned a OG members block and played about with the fields to get the assignee options showing as the members of the assigned group of the case node. Only problem is I can only user the username in the views field selection, I've tried everything to get profile fields (position, company, first name etc) and also realname fields instead of the username. Unfortunately this means on a tracker system for an client based extranet using the system we'd have users not knowing who's who. One user might be Joe Bloggs, Client Manager, Acme Industries using username donaldduck but another username won't know that and hasn't got time to go messing around looking at accounts or OG members blocks etc.
You help on this small but important issue is appreciated. Below is my current view export for info, or if someone else wants to use it.
$view = new view;
$view->name = 'casetracker_assignee_options_NEW';
$view->description = 'Assignee options for case tracker';
$view->tag = 'casetracker';
$view->view_php = '';
$view->base_table = 'users';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
'nid' => array(
'id' => 'nid',
'table' => 'og_uid',
'field' => 'nid',
'label' => 'Group',
'required' => 0,
'relationship' => 'none',
),
));
$handler->override_option('fields', array(
'name' => array(
'label' => 'Name',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_user' => 1,
'overwrite_anonymous' => 0,
'anonymous_text' => '',
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'created' => array(
'id' => 'created',
'table' => 'og_uid',
'field' => 'created',
'order' => 'DESC',
'granularity' => 'second',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'nid' => array(
'id' => 'nid',
'table' => 'og_uid',
'field' => 'nid',
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(
'count' => TRUE,
'override' => FALSE,
'items_per_page' => 25,
),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'default_argument_type' => 'php',
'default_argument' => '',
'validate_type' => 'og_group_types',
'validate_fail' => 'not found',
'break_phrase' => 0,
'add_table' => 0,
'relationship' => 'none',
'default_argument_fixed' => '39',
'default_argument_php' => 'if ($node = og_get_group_context()) {
return $node->nid;
}
else {
return NULL;
}',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'book' => 0,
'group1' => 0,
'group2' => 0,
'page' => 0,
'story' => 0,
),
'validate_argument_php' => '',
'require_value' => 0,
'reduce_duplicates' => 0,
'validate_argument_vocabulary' => array(
'1' => 0,
'2' => 0,
'3' => 0,
'4' => 0,
),
'validate_argument_type' => 'tid',
'default_argument_user' => 0,
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'not' => 0,
'validate_argument_is_member' => 1,
),
));
$handler->override_option('filters', array(
'status' => array(
'id' => 'status',
'table' => 'users',
'field' => 'status',
'operator' => '=',
'value' => 1,
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
'expose_button' => array(
'button' => 'Expose',
),
),
'is_active' => array(
'id' => 'is_active',
'table' => 'og_uid',
'field' => 'is_active',
'operator' => '=',
'value' => 1,
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
'expose_button' => array(
'button' => 'Expose',
),
),
'is_admin' => array(
'id' => 'is_admin',
'table' => 'og_uid',
'field' => 'is_admin',
'operator' => 'in',
'value' => array(
'0' => '0',
'1' => '1',
),
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
'expose_button' => array(
'button' => 'Expose',
),
),
));
$handler->override_option('access', array(
'type' => 'none',
'role' => array(),
'perm' => '',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'OG Member Selection for Case Tracker');
$handler->override_option('empty_format', '1');
$handler->override_option('items_per_page', 0);
$handler->override_option('use_pager', '0');
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
'type' => 'ul',
));
$handler->override_option('row_options', array(
'inline' => array(
'name' => 'name',
'is_admin' => 'is_admin',
),
'separator' => ' ',
));
Comments
Comment #1
dagmarYes, this is because assign_to is not joined to user table.
See this for a solution for your problem #759566: Make assigned to a view relationship
If it's useful for you, please mark this issue as a duplicate.
Comment #3
jmiccolis commented@dagmar, adding a relationship is absolutely the way to go here.