summaryrefslogtreecommitdiffstats
path: root/app/helpers/timelog_helper.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-08-09 02:50:11 +0000
committerGo MAEDA <maeda@farend.jp>2022-08-09 02:50:11 +0000
commit38f7a064051f581ea3a6f40f6957cf5e2021ce7a (patch)
tree83446b1c47c5743724ce837e81dff8cb9ebc6231 /app/helpers/timelog_helper.rb
parent5c5ae4637c903279f6297aa73a7b0035d3bfb59d (diff)
downloadredmine-38f7a064051f581ea3a6f40f6957cf5e2021ce7a.tar.gz
redmine-38f7a064051f581ea3a6f40f6957cf5e2021ce7a.zip
Add default spent time activity per role (#29286).
Patch by Marius BALTEANU and Mizuki ISHIKAWA. git-svn-id: https://svn.redmine.org/redmine/trunk@21763 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/timelog_helper.rb')
-rw-r--r--app/helpers/timelog_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb
index e82da6e31..aed649b9e 100644
--- a/app/helpers/timelog_helper.rb
+++ b/app/helpers/timelog_helper.rb
@@ -48,6 +48,14 @@ module TimelogHelper
principals_options_for_select(collection, time_entry.user_id.to_s)
end
+ def default_activity(time_entry)
+ if @project
+ time_entry.activity_id
+ else
+ TimeEntryActivity.default_activity_id(User.current, time_entry.project)
+ end
+ end
+
def select_hours(data, criteria, value)
if value.to_s.empty?
data.select {|row| row[criteria].blank?}