プロジェクト

全般

プロフィール

Vote #78356

未完了

List of role members

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Needs feedback
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
0
issue_org_id:
25491
author_id:
4
assigned_to_id:
0
comments:
9
status_id:
10
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Needs feedback]

説明

This simple patch provides a list of all members of a role grouped by projects.

Tested and working with Redmine 3.2 & 3.3


journals

--------------------------------------------------------------------------------
!http://www.redmine.org/attachments/download/18018/members.jpg!

----------------

!http://www.redmine.org/attachments/download/18019/list.jpg!
--------------------------------------------------------------------------------
Screenshot of "Members" view introduced by this patch. "eCookbook", "OnlineStore" and "Private child of eCookbook" are project name.

!role-members-by-project.png!
--------------------------------------------------------------------------------
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:*
!members-link-before.png!

*after:*
!members-link-after.png!
--------------------------------------------------------------------------------
Thank you very much for those fixes !
--------------------------------------------------------------------------------
Go MAEDA wrote:
> I slightly changed the patch.

It seems app/views/roles/members.html.erb is missing in your patch.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Toshi MARUYAMA wrote:
> It seems app/views/roles/members.html.erb is missing in your patch.

Fixed my patch and attached attachment:25491-list-of-role-members-v3.diff. Thank you for pointing it out.

--------------------------------------------------------------------------------
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:
<pre>
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'
</pre>

Am I missing something?
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリUI_10 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0