|
|
|
@ -113,6 +113,8 @@ class UsersController < ApplicationController
|
|
|
|
|
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?
|
|
|
|
@ -424,6 +426,23 @@ class UsersController < ApplicationController
|
|
|
|
|
@state = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if params[:user].present?
|
|
|
|
|
user_temp = User.find_by_sql("select id from users where firstname like '%#{params[:user]}%' or lastname like '%#{params[:user]}%'")
|
|
|
|
|
if user_temp.size > 1
|
|
|
|
|
activity = Activity.where('user_id in (?)', user_temp).order('id desc')
|
|
|
|
|
elsif user_temp.size == 1
|
|
|
|
|
activity = Activity.where('user_id = ?', user_temp).order('id desc')
|
|
|
|
|
else
|
|
|
|
|
activity = Activity.where("1 = 0")
|
|
|
|
|
end
|
|
|
|
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
|
|
|
|
@activity_count = activity.count
|
|
|
|
|
@activity_pages = Paginator.new @activity_count, @limit, params['page']
|
|
|
|
|
@offset ||= @activity_pages.offset
|
|
|
|
|
@activity = activity.offset(@offset).limit(@limit)
|
|
|
|
|
@state = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Modified by nie
|
|
|
|
|
unless User.current.admin?
|
|
|
|
|