summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry_query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-30 16:42:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-30 16:42:55 +0000
commite89b93f8d1b9c92b7f6df6b2fc70a36fd5e27e76 (patch)
tree8374d5d16ffe4b967b9ebe155d0fb44b16f31828 /app/models/time_entry_query.rb
parentd42d8492b8497a4be721f12ef045f368e4a33b3d (diff)
downloadredmine-e89b93f8d1b9c92b7f6df6b2fc70a36fd5e27e76.tar.gz
redmine-e89b93f8d1b9c92b7f6df6b2fc70a36fd5e27e76.zip
Fill the issue id when logging time from the time log list of an issue (#26520).
git-svn-id: http://svn.redmine.org/redmine/trunk@16924 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/time_entry_query.rb')
-rw-r--r--app/models/time_entry_query.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb
index 600909dfd..bc7ef3b18 100644
--- a/app/models/time_entry_query.rb
+++ b/app/models/time_entry_query.rb
@@ -113,6 +113,13 @@ class TimeEntryQuery < Query
[['spent_on', 'desc']]
end
+ # If a filter against a single issue is set, returns its id, otherwise nil.
+ def filtered_issue_id
+ if value_for('issue_id').to_s =~ /\A(\d+)\z/
+ $1
+ end
+ end
+
def base_scope
TimeEntry.visible.
joins(:project, :user).