Project

General

Profile

Actions

Feature #41053

closed

Add "User's group" and "User's role" filters to Spent time list

Added by Go MAEDA 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Time tracking
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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

clipboard-202407241039-f2ps2.png (406 KB) clipboard-202407241039-f2ps2.png Go MAEDA, 2024-07-24 03:39
41053.patch (7.25 KB) 41053.patch Takenori TAKAKI, 2024-08-05 07:15
41053-v2.patch (5.72 KB) 41053-v2.patch Go MAEDA, 2024-08-13 10:29
Actions #1

Updated by Takenori TAKAKI 5 months ago

I have created a patch to add the following filters to the Spent time list.
  • 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).

Actions #2

Updated by Go MAEDA 4 months ago

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]}}
)

Actions #3

Updated by Go MAEDA 4 months ago

  • Target version changed from Candidate for next major release to 6.0.0

Setting the target version to 6.0.0.

Actions #4

Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r22958. Thank you.

Actions

Also available in: Atom PDF