Patch #25491
openList of role members
Added by Anonymous over 7 years ago. Updated over 7 years ago.
0%
Description
This simple patch provides a list of all members of a role grouped by projects.
Tested and working with Redmine 3.2 & 3.3
Files
list-of-role-members.patch (3.47 KB) list-of-role-members.patch | Anonymous, 2017-03-31 23:10 | ||
members.jpg (23.7 KB) members.jpg | Anonymous, 2017-03-31 23:12 | ||
list.jpg (21.2 KB) list.jpg | Anonymous, 2017-03-31 23:12 | ||
role-members-by-project.png (59.5 KB) role-members-by-project.png | Go MAEDA, 2017-04-01 10:59 | ||
members-link-before.png (8.55 KB) members-link-before.png | Go MAEDA, 2017-04-01 11:39 | ||
members-link-after.png (8.63 KB) members-link-after.png | Go MAEDA, 2017-04-01 11:40 | ||
25491-list-of-role-members-v3.diff (4.78 KB) 25491-list-of-role-members-v3.diff | Go MAEDA, 2017-05-01 07:47 |
Updated by Anonymous over 7 years ago
- File members.jpg members.jpg added
- File list.jpg list.jpg added
Updated by Go MAEDA over 7 years ago
Screenshot of "Members" view introduced by this patch. "eCookbook", "OnlineStore" and "Private child of eCookbook" are project name.
Updated by Go MAEDA over 7 years ago
- File 25491-list-of-role-members-v2.diff added
- File members-link-before.png members-link-before.png added
- File members-link-after.png members-link-after.png added
I slightly changed the patch.
- Replaced :notice_file_not_found ("The page you were trying to access doesn't exist or has been removed.") with :label_no_data ("No data to display") for consistency with other pages.
- Always displays "Members" link to fix horizontal position of sort handle.
before - sort handle horizontal position is not aligned:
after:
Updated by Toshi MARUYAMA over 7 years ago
Go MAEDA wrote:
I slightly changed the patch.
It seems app/views/roles/members.html.erb is missing in your patch.
Updated by Go MAEDA over 7 years ago
- File deleted (
25491-list-of-role-members-v2.diff)
Updated by Go MAEDA over 7 years ago
Toshi MARUYAMA wrote:
It seems app/views/roles/members.html.erb is missing in your patch.
Fixed my patch and attached 25491-list-of-role-members-v3.diff. Thank you for pointing it out.
Updated by Mischa The Evil over 7 years ago
- Status changed from New to Needs feedback
I think this could be a useful addition for instances with bigger number of users, roles and projects. I've tried the patch from note-8 (after manually transplanting it to source:/trunk@16580) for testing, but it seems something is wrong. I get the following error upon request:
Started GET "/roles/3/members" for 192.168.1.3 at 2017-06-02 09:31:47 +0200 Processing by RolesController#members as HTML Parameters: {"id"=>"3"} SQL (4.0ms) UPDATE `tokens` SET `tokens`.`updated_on` = '2017-06-02 09:31:47' WHERE `tokens`.`user_id` = 1 AND `tokens`.`value` = '<<snip>>' AND `tokens`.`action` = 'session' (0.1ms) SELECT MAX(`settings`.`updated_on`) FROM `settings` User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`status` = 1 AND `users`.`id` = 1 LIMIT 1 Current user: admin (id=1) Role Load (0.1ms) SELECT `roles`.* FROM `roles` WHERE `roles`.`id` = 3 LIMIT 1 Member Load (1.2ms) SELECT `members`.* FROM `members` INNER JOIN `member_roles` ON `member_roles`.`member_id` = `members`.`id` INNER JOIN `roles` ON `roles`.`id` = `member_roles`.`role_id` INNER JOIN `users` ON `users`.`id` = `members`.`user_id` AND `users`.`type` IN ('User', 'AnonymousUser') WHERE `roles`.`id` = 3 GROUP BY `users`, `members`.`id` Completed 500 Internal Server Error in 22ms (ActiveRecord: 5.6ms) ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'users' in 'group statement': SELECT `members`.* FROM `members` INNER JOIN `member_roles` ON `member_roles`.`member_id` = `members`.`id` INNER JOIN `roles` ON `roles`.`id` = `member_roles`.`role_id` INNER JOIN `users` ON `users`.`id` = `members`.`user_id` AND `users`.`type` IN ('User', 'AnonymousUser') WHERE `roles`.`id` = 3 GROUP BY `users`, `members`.`id`): app/controllers/roles_controller.rb:107:in `members' lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Am I missing something?