Project

General

Profile

Patch #14692 » RM_14692_timelog_controller_redirections_tweak.diff

Jérôme BATAILLE, 2013-08-14 16:40

View differences:

timelog_controller.rb (revision 1811)
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_back_or_default :action => 'index', :project_id => @time_entry.project
# Fix : after update redirect to the issue time entries list if possible
redirect_to :action => 'index', :project_id => @time_entry.project, :issue_id => @time_entry.issue_id
}
format.api { head :ok }
end
......
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_delete)
redirect_back_or_default(:action => 'index', :project_id => @projects.first)
# FIX : after deletion, get back to the issue time entries list if not in bulk edit mode
only_time_entry = nil
if @time_entries.present? && (@time_entries.size == 1)
only_time_entry = @time_entries.first
end
if only_time_entry.present?
redirect_to(:action => 'index', :project_id => only_time_entry.project_id, :issue_id => only_time_entry.issue_id)
else
redirect_back_or_default(:action => 'index', :project_id => @projects.first)
end
# END -- Smile specific FIX : Get back to the time entries for the issue if not in bulk edit mode
}
format.api { head :ok }
end
    (1-1/1)