diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index 8e9cf3ee1e..1126a09193 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -47,7 +47,8 @@ class ActivitiesController < ApplicationController @activity = Redmine::Activity::Fetcher.new(User.current, :project => @project, :with_subprojects => @with_subprojects, :author => @author) - @activity.scope_select {|t| !params["show_#{t}"].nil?} + + set_activity_scope events = @activity.events(@date_from, @date_to) censor_events_from_projects_with_disabled_activity!(events) unless @project @@ -99,4 +100,16 @@ class ActivitiesController < ApplicationController event.project_id.nil? || allowed_project_ids.include?(event.project_id) end end + + def set_activity_scope + if params[:apply] + @activity.scope_select {|t| !params["show_#{t}"].nil?} + elsif session[:activity] + @activity.scope = session[:activity] + else + @activity.scope = (@author.nil? ? :default : :all) + end + + session[:activity] = @activity.scope + end end diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb index 8915cc45a8..9ef090b6d1 100644 --- a/app/views/activities/index.html.erb +++ b/app/views/activities/index.html.erb @@ -93,6 +93,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %> + <%= hidden_field_tag('apply', true) %><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %>
<% end %> <% end %>