Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2009 at 15:13 UTC
Updated:
12 Oct 2009 at 08:30 UTC
Hello,
I built this really cool user admin view with VBO that I believe is way better than the default Drupal user management interface.
Admin user can access it at mysite.com/manage-user
Have fun using it, and report if you see any issues with it.
Check out my term management view as well: http://drupal.org/node/537418
$view = new view;
$view->name = 'manage_user';
$view->description = '';
$view->tag = '';
$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('fields', array(
'created' => array(
'label' => 'Created date',
'date_format' => 'small',
'custom_date_format' => '',
'exclude' => 0,
'id' => 'created',
'table' => 'users',
'field' => 'created',
'relationship' => 'none',
),
'mail' => array(
'label' => 'E-mail',
'link_to_user' => 'user',
'exclude' => 0,
'id' => 'mail',
'table' => 'users',
'field' => 'mail',
'relationship' => 'none',
),
'edit_node' => array(
'label' => 'Edit link',
'text' => '',
'exclude' => 0,
'id' => 'edit_node',
'table' => 'users',
'field' => 'edit_node',
'relationship' => 'none',
),
'login' => array(
'label' => 'Last login',
'date_format' => 'small',
'custom_date_format' => '',
'exclude' => 0,
'id' => 'login',
'table' => 'users',
'field' => 'login',
'relationship' => 'none',
),
'name' => array(
'label' => 'Name',
'link_to_user' => 1,
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'relationship' => 'none',
),
'picture' => array(
'label' => 'Picture',
'exclude' => 0,
'id' => 'picture',
'table' => 'users',
'field' => 'picture',
'relationship' => 'none',
),
'rid' => array(
'label' => 'Roles',
'type' => 'separator',
'separator' => ', ',
'empty' => '',
'exclude' => 0,
'id' => 'rid',
'table' => 'users_roles',
'field' => 'rid',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'created' => array(
'order' => 'DESC',
'granularity' => 'second',
'id' => 'created',
'table' => 'users',
'field' => 'created',
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'created' => array(
'operator' => 'between',
'value' => array(
'type' => 'date',
'value' => '',
'min' => '',
'max' => '',
),
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'created_op',
'identifier' => 'created',
'label' => 'User: Created date',
'optional' => 1,
'remember' => 0,
),
'id' => 'created',
'table' => 'users',
'field' => 'created',
'relationship' => 'none',
),
'mail' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => FALSE,
'operator' => 'mail_op',
'identifier' => 'mail',
'label' => 'User: E-mail',
'remember' => FALSE,
'single' => TRUE,
'optional' => TRUE,
),
'case' => TRUE,
'id' => 'mail',
'table' => 'users',
'field' => 'mail',
),
'login' => array(
'operator' => 'between',
'value' => array(
'type' => 'date',
'value' => '',
'min' => '',
'max' => '',
),
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'login_op',
'identifier' => 'login',
'label' => 'User: Last login',
'optional' => 1,
'remember' => 0,
),
'id' => 'login',
'table' => 'users',
'field' => 'login',
'relationship' => 'none',
),
'uid' => array(
'operator' => 'in',
'value' => '',
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'uid_op',
'identifier' => 'uid',
'label' => 'User: Name',
'optional' => 1,
'remember' => 0,
'reduce' => 0,
),
'id' => 'uid',
'table' => 'users',
'field' => 'uid',
'relationship' => 'none',
),
'rid' => array(
'operator' => 'or',
'value' => array(),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'rid',
'table' => 'users_roles',
'field' => 'rid',
'relationship' => 'none',
'reduce_duplicates' => 0,
),
));
$handler->override_option('access', array(
'type' => 'perm',
'perm' => 'administer nodes',
));
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 20);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'bulk');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'created' => 'created',
'mail' => 'mail',
'edit_node' => 'edit_node',
'login' => 'login',
'name' => 'name',
'picture' => 'picture',
'rid' => 'rid',
),
'info' => array(
'created' => array(
'sortable' => 0,
'separator' => '',
),
'mail' => array(
'sortable' => 0,
'separator' => '',
),
'edit_node' => array(
'separator' => '',
),
'login' => array(
'sortable' => 0,
'separator' => '',
),
'name' => array(
'sortable' => 0,
'separator' => '',
),
'picture' => array(
'sortable' => 0,
'separator' => '',
),
'rid' => array(
'separator' => '',
),
),
'default' => '-1',
'execution_type' => '2',
'display_type' => '0',
'skip_confirmation' => 0,
'display_result' => 1,
'merge_single_action' => 1,
'selected_operations' => array(
'dfdea479cc7ae8cb9d3e8749e57f86b4' => 'dfdea479cc7ae8cb9d3e8749e57f86b4',
'4d075a755ad70f936bf89570e66196f1' => '4d075a755ad70f936bf89570e66196f1',
'a011c04389ff75f79af39bb612089bca' => 'a011c04389ff75f79af39bb612089bca',
'132fddcb3f367a243bee632db31985c1' => '132fddcb3f367a243bee632db31985c1',
'1f6347716d703156f85c9a5dac5707ae' => 0,
'4fff50383fdc48042390841723c0d719' => 0,
'334d20af1ae7ac4b770b7ec3210b2638' => 0,
'73e0815d78610c8e7538ec8c5ad0be0c' => 0,
'17638717a4113cb1c06833374060f51e' => 0,
'c7d1ab5f3d903c3b88e798659ef906cc' => 0,
'52aec7fee2070ce530da1304653ae1ec' => 0,
'daa75f478e3093ab107e657da6620a91' => 0,
'4bd509ad947296ffe30e8092a438e096' => 0,
),
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'manage-user');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
Comments
Comment #1
giorgio79 commentedAlso posted this in the forum :)
http://drupal.org/node/537424
Comment #2
infojunkieThanks giorgio for sharing! I'll take a look at them.
In the Views code you've pasted, I see that the actions are encoded in the old, pre 1.7 way. If you can, please upgrade your VBO to the latest dev, run upgrade.php and post the upgraded view.
You might also be interested in Views Block (http://drupal.org/project/views_block), a module I wrote to manage blocks using VBO.
Comment #3
giorgio79 commentedThanks Karim, that Block view is sweet :)
Here is the updated user management view:
If we could have some views like this with VBO prepackaged, so users only have to enable it, that would bring in lots more novice users I Believe :P
Comment #4
giorgio79 commentedHere is v3, I realized I forgot to unlock the operators for the filters. This makes it much more flexible.
Comment #5
giorgio79 commentedSetting this as fixed for now :) Any improvements are welcome, please share.
Would love to see some standard management VBO enhanced views included with VBO :)