|
|
|
@ -35,7 +35,6 @@ class UsersController < ApplicationController
|
|
|
|
|
### added by william
|
|
|
|
|
include ActsAsTaggableOn::TagsHelper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
helper :watchers
|
|
|
|
|
helper :activities
|
|
|
|
|
|
|
|
|
@ -74,14 +73,19 @@ class UsersController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# added by fq
|
|
|
|
|
def user_activities
|
|
|
|
|
#####fq
|
|
|
|
|
# @message = MessagesForUser.find_message(@user.id)
|
|
|
|
|
# show projects based on current user visibility
|
|
|
|
|
# @memberships = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
|
|
|
|
|
|
|
|
|
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 30)
|
|
|
|
|
@watcher = User.watched_by_id(@user)
|
|
|
|
|
events = []
|
|
|
|
|
for user in @watcher
|
|
|
|
|
events << Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 30)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@events_by_day = events.group_by(&:event_date)
|
|
|
|
|
|
|
|
|
|
unless User.current.admin?
|
|
|
|
@ -96,6 +100,7 @@ class UsersController < ApplicationController
|
|
|
|
|
format.api
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
def user_newfeedback
|
|
|
|
|
@jour = @user.journals_for_messages
|
|
|
|
@ -107,6 +112,7 @@ class UsersController < ApplicationController
|
|
|
|
|
def user_comments
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#end
|
|
|
|
|
def index
|
|
|
|
|
sort_init 'login', 'asc'
|
|
|
|
@ -125,7 +131,6 @@ class UsersController < ApplicationController
|
|
|
|
|
}
|
|
|
|
|
# @count = Redmine::Activity::Fetcher.new(User.current, :author => @user).scope_select {|t| !has["show_#{t}"].nil?}.events(nil, nil).count
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scope = User.logged.status(@status)
|
|
|
|
|
scope = scope.like(params[:name]) if params[:name].present?
|
|
|
|
|
scope = scope.in_group(params[:group_id]) if params[:group_id].present?
|
|
|
|
@ -144,13 +149,23 @@ class UsersController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
### modified by fq
|
|
|
|
|
def show
|
|
|
|
|
#####fq
|
|
|
|
|
@message = MessagesForUser.find_message(@user.id)
|
|
|
|
|
# show projects based on current user visibility
|
|
|
|
|
@memberships = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
|
|
|
|
|
|
|
|
|
if @user == User.current
|
|
|
|
|
events = []
|
|
|
|
|
events += Redmine::Activity::Fetcher.new(User.current, :author => User.current).events(nil, nil, :limit => 10)
|
|
|
|
|
@watcher = User.watched_by(@user)
|
|
|
|
|
for user in @watcher
|
|
|
|
|
events += Redmine::Activity::Fetcher.new(User.current, :author => user).events(nil, nil, :limit => 10)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@events_by_day = events.group_by(&:event_date)
|
|
|
|
|
|
|
|
|
|
unless User.current.admin?
|
|
|
|
@ -166,6 +181,8 @@ class UsersController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
##end fq
|
|
|
|
|
|
|
|
|
|
def new
|
|
|
|
|
@user = User.new(:language => Setting.default_language, :mail_notification => Setting.default_notification_option)
|
|
|
|
|
@auth_sources = AuthSource.all
|
|
|
|
|