修复未公开项目动态仍在主页最新动态显示的问题
This commit is contained in:
parent
0dce86d47e
commit
358d4a53b8
|
@ -333,7 +333,7 @@ module WelcomeHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
#取得所有活动
|
#取得所有活动
|
||||||
def find_all_activities limit=6
|
def find_all_activities limit=6
|
||||||
# users = []
|
# users = []
|
||||||
# activities = Activity.find_by_sql("select distinct user_id from activities order by id DESC limit #{limit}" )
|
# activities = Activity.find_by_sql("select distinct user_id from activities order by id DESC limit #{limit}" )
|
||||||
# activities.each { |activity|
|
# activities.each { |activity|
|
||||||
|
|
|
@ -88,10 +88,21 @@ module Redmine
|
||||||
def events_welcome(from = nil, to = nil, options={})
|
def events_welcome(from = nil, to = nil, options={})
|
||||||
e = []
|
e = []
|
||||||
@options[:limit] = options[:limit]
|
@options[:limit] = options[:limit]
|
||||||
|
|
||||||
@scope.each do |event_type|
|
@scope.each do |event_type|
|
||||||
constantized_providers(event_type).each do |provider|
|
constantized_providers(event_type).each do |provider|
|
||||||
e += provider.find_events1(event_type, @user, from, to, @options)
|
cur_objs = provider.find_events1(event_type, @user, from, to, @options)
|
||||||
|
cur_objs.each do |cur_obj|
|
||||||
|
if cur_obj.class == Issue
|
||||||
|
if cur_obj.project != nil && cur_obj.project.project_status != nil
|
||||||
|
e += [cur_obj]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
e += [cur_obj]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if e.count > options[:limit]
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue