summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-07 23:01:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-07 23:01:24 +0000
commita069c4afcfc5a78853155f43dc1ae7df67c96c87 (patch)
tree36e4dd89882ca4f95a2546696e9a0a7eed1b4e89 /app
parentcc8220dde80c64027151a065f3dcc7f34a72f0af (diff)
downloadredmine-a069c4afcfc5a78853155f43dc1ae7df67c96c87.tar.gz
redmine-a069c4afcfc5a78853155f43dc1ae7df67c96c87.zip
Added forums topics on the activity view (disabled by default).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@891 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 8db55ba0d..b4ffe57e8 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -390,15 +390,16 @@ class ProjectsController < ApplicationController
@date_to = @date_from >> 1
end
- @event_types = %w(issues news files documents wiki_pages changesets)
+ @event_types = %w(issues news files documents changesets wiki_pages messages)
@event_types.delete('wiki_pages') unless @project.wiki
@event_types.delete('changesets') unless @project.repository
+ @event_types.delete('messages') unless @project.boards.any?
# only show what the user is allowed to view
@event_types = @event_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
@scope = @event_types.select {|t| params["show_#{t}"]}
# default events if none is specified in parameters
- @scope = (@event_types - %w(wiki_pages))if @scope.empty?
+ @scope = (@event_types - %w(wiki_pages messages))if @scope.empty?
@events = []
@@ -436,6 +437,12 @@ class ProjectsController < ApplicationController
@events += @project.repository.changesets.find(:all, :conditions => ["#{Changeset.table_name}.committed_on BETWEEN ? AND ?", @date_from, @date_to])
end
+ if @scope.include?('messages')
+ @events += Message.find(:all,
+ :include => [:board, :author],
+ :conditions => ["#{Board.table_name}.project_id=? AND #{Message.table_name}.parent_id IS NULL AND #{Message.table_name}.created_on BETWEEN ? AND ?", @project.id, @date_from, @date_to])
+ end
+
@events_by_day = @events.group_by(&:event_date)
respond_to do |format|