summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-12 19:28:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-12 19:28:49 +0000
commit03dbf8abb881e333256b1cf046b04532b3164d21 (patch)
treea85915265ada3067d3d94e40e14cf1540f87a1af /app/controllers
parentf01b0887ff3ac48bfc7a45b05a8ec17891ddfe19 (diff)
downloadredmine-03dbf8abb881e333256b1cf046b04532b3164d21.tar.gz
redmine-03dbf8abb881e333256b1cf046b04532b3164d21.zip
Remove special behaviour for listing issue time entries, use a filter for that.
git-svn-id: http://svn.redmine.org/redmine/trunk@15644 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/timelog_controller.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index a0f0ea31d..a63ffae82 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -22,7 +22,8 @@ class TimelogController < ApplicationController
before_filter :find_time_entries, :only => [:bulk_edit, :bulk_update, :destroy]
before_filter :authorize, :only => [:show, :edit, :update, :bulk_edit, :bulk_update, :destroy]
- before_filter :find_optional_project, :only => [:new, :create, :index, :report]
+ before_filter :find_optional_issue, :only => [:new, :create]
+ before_filter :find_optional_project, :only => [:index, :report]
before_filter :authorize_global, :only => [:new, :create, :index, :report]
accept_rss_auth :index
@@ -251,11 +252,17 @@ private
end
end
- def find_optional_project
+ def find_optional_issue
if params[:issue_id].present?
@issue = Issue.find(params[:issue_id])
@project = @issue.project
- elsif params[:project_id].present?
+ else
+ find_optional_project
+ end
+ end
+
+ def find_optional_project
+ if params[:project_id].present?
@project = Project.find(params[:project_id])
end
rescue ActiveRecord::RecordNotFound
@@ -264,11 +271,7 @@ private
# Returns the TimeEntry scope for index and report actions
def time_entry_scope(options={})
- scope = @query.results_scope(options)
- if @issue
- scope = scope.on_issue(@issue)
- end
- scope
+ @query.results_scope(options)
end
def retrieve_time_entry_query