Feature #41053
closedAdd "User's group" and "User's role" filters to Spent time list
0%
Description
I suggest adding "User's group" and "User's role" filters to the Spent time list. Currently, there is a filter for "User", but it would be beneficial to filter by the user's group or role as well.
"User's group" and "User's role" filters are already available in the issues list, and having the same functionality in the Spent time list would be useful. For example, these filters would make it easier to list the time entries of a specific department within an organization.
Files
Updated by Takenori TAKAKI 5 months ago
- File 41053.patch 41053.patch added
- User's Group: filter for users in the group.
- User's Role: filter for users with a role set
The patch works with the latest version of trunk (r22945).
Updated by Go MAEDA 4 months ago
- File 41053-v2.patch 41053-v2.patch added
- Target version set to Candidate for next major release
Thank you for posting the patch.
I have updated the patch to use the "association filter" mechanism like the existing issue related filters ("Issue's Tracker", "Issue's Parant task", ...). This can simplify the patch a bit.
Original code:
add_available_filter(
"user_group",
:type => :list_optional,
:values => lambda {Group.givable.visible.pluck(:name, :id).map {|name, id| [name, id.to_s]}}
)
Using association filter mechanism:
add_available_filter(
"user.group",
:type => :list_optional,
:name => l("label_attribute_of_user", :name => l(:label_group)),
:values => lambda {Group.givable.visible.pluck(:name, :id).map {|name, id| [name, id.to_s]}}
)