Differs between activity view states

pull/844/head
Hagen Schink 11 years ago
parent 94f4428869
commit 740d896f08
  1. 15
      app/controllers/activities_controller.rb
  2. 1
      app/views/activities/index.html.erb

@ -47,7 +47,8 @@ class ActivitiesController < ApplicationController
@activity = Redmine::Activity::Fetcher.new(User.current, :project => @project, @activity = Redmine::Activity::Fetcher.new(User.current, :project => @project,
:with_subprojects => @with_subprojects, :with_subprojects => @with_subprojects,
:author => @author) :author => @author)
@activity.scope_select {|t| !params["show_#{t}"].nil?}
set_activity_scope
events = @activity.events(@date_from, @date_to) events = @activity.events(@date_from, @date_to)
censor_events_from_projects_with_disabled_activity!(events) unless @project 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) event.project_id.nil? || allowed_project_ids.include?(event.project_id)
end end
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 end

@ -93,6 +93,7 @@ See doc/COPYRIGHT.rdoc for more details.
<p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p> <p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
<% end %> <% end %>
<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %> <%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
<%= hidden_field_tag('apply', true) %>
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p> <p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
<% end %> <% end %>
<% end %> <% end %>

Loading…
Cancel
Save