modify admin show

BY nieguanfei && huangjinquan
This commit is contained in:
xianbo 2013-11-13 20:17:11 +08:00
parent 2d90215de2
commit 5366b50c56
1 changed files with 7 additions and 3 deletions

View File

@ -59,9 +59,13 @@ class UsersController < ApplicationController
helper :words
#added by young
def user_projects
cond = Project.visible_condition(User.current) + "AND projects.project_type <> 1"
@memberships = @user.memberships.all(:conditions => cond)
if User.current.admin?
@memberships = @user.memberships.all
else
cond = Project.visible_condition(User.current) + "AND projects.project_type <> 1"
@memberships = @user.memberships.all(:conditions => cond)
end
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
@events_by_day = events.group_by(&:event_date)
@state = 0