summaryrefslogtreecommitdiffstats
path: root/app/controllers/activities_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-15 19:06:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-15 19:06:22 +0000
commit589bde0899cc72c7a5c253a6f1da4e0408de031f (patch)
treee3d4c23d04dea43b7db4505dcd641e273910bf32 /app/controllers/activities_controller.rb
parent486a4dfbc82a5ffc5dd89f94bb44edd5a7f127cd (diff)
downloadredmine-589bde0899cc72c7a5c253a6f1da4e0408de031f.tar.gz
redmine-589bde0899cc72c7a5c253a6f1da4e0408de031f.zip
Activity page to remember user's selection of activities (#1605).
git-svn-id: http://svn.redmine.org/redmine/trunk@14678 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/activities_controller.rb')
-rw-r--r--app/controllers/activities_controller.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index 717997d90..00d03487a 100644
--- a/app/controllers/activities_controller.rb
+++ b/app/controllers/activities_controller.rb
@@ -37,8 +37,21 @@ class ActivitiesController < ApplicationController
@activity = Redmine::Activity::Fetcher.new(User.current, :project => @project,
:with_subprojects => @with_subprojects,
:author => @author)
+ pref = User.current.pref
@activity.scope_select {|t| !params["show_#{t}"].nil?}
- @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
+ if @activity.scope.present?
+ if params[:submit].present?
+ pref.activity_scope = @activity.scope
+ pref.save
+ end
+ else
+ if @author.nil?
+ scope = pref.activity_scope & @activity.event_types
+ @activity.scope = scope.present? ? scope : :default
+ else
+ @activity.scope = :all
+ end
+ end
events = @activity.events(@date_from, @date_to)