diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 65dd9a470..efc9dce4d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -78,6 +78,16 @@ class UsersController < ApplicationController # show projects based on current user visibility @memberships = @user.memberships.preload(:roles, :project).where(Project.visible_condition(User.current)).to_a + @issue_counts = {} + @issue_counts[:assigned] = { + :total => Issue.visible.assigned_to(@user).count, + :open => Issue.visible.open.assigned_to(@user).count + } + @issue_counts[:reported] = { + :total => Issue.visible.where(:author_id => @user.id).count, + :open => Issue.visible.open.where(:author_id => @user.id).count + } + respond_to do |format| format.html { events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index b7ceba01a..488e4b93a 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -23,14 +23,57 @@
| + | <%=l(:label_open_issues_plural)%> | +<%=l(:label_closed_issues_plural)%> | +<%=l(:label_total)%> | +
|---|---|---|---|
| + <%= link_to l(:label_assigned_issues), + issues_path(:set_filter => 1, :assigned_to_id => assigned_to_ids, :sort => sort_cond) %> + | ++ <%= link_to @issue_counts[:assigned][:open], + issues_path(:set_filter => 1, :assigned_to_id => assigned_to_ids, :sort => sort_cond) %> + | ++ <%= link_to @issue_counts[:assigned][:total] - @issue_counts[:assigned][:open], + issues_path(:set_filter => 1, :status_id => 'c', :assigned_to_id => assigned_to_ids, :sort => sort_cond) %> + | ++ <%= link_to @issue_counts[:assigned][:total], + issues_path(:set_filter => 1, :status_id => '*', :assigned_to_id => assigned_to_ids, :sort => sort_cond) %> + | +
| + <%= link_to l(:label_reported_issues), + issues_path(:set_filter => 1, :author_id => @user.id, :sort => sort_cond) %> + | ++ <%= link_to @issue_counts[:reported][:open], + issues_path(:set_filter => 1, :author_id => @user.id, :sort => sort_cond) %> + | ++ <%= link_to @issue_counts[:reported][:total] - @issue_counts[:reported][:open], + issues_path(:set_filter => 1, :status_id => 'c', :author_id => @user.id, :sort => sort_cond) %> + | ++ <%= link_to @issue_counts[:reported][:total], + issues_path(:set_filter => 1, :status_id => '*', :author_id => @user.id, :sort => sort_cond) %> + | +