diff options
author | Go MAEDA <maeda@farend.jp> | 2022-08-09 02:50:11 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-08-09 02:50:11 +0000 |
commit | 38f7a064051f581ea3a6f40f6957cf5e2021ce7a (patch) | |
tree | 83446b1c47c5743724ce837e81dff8cb9ebc6231 /app/views | |
parent | 5c5ae4637c903279f6297aa73a7b0035d3bfb59d (diff) | |
download | redmine-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/views')
-rw-r--r-- | app/views/roles/_form.html.erb | 4 | ||||
-rw-r--r-- | app/views/timelog/new.js.erb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index e149b0011..44bc54c75 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -39,6 +39,10 @@ </p> <% end %> + <% unless @role.anonymous? %> + <p><%= f.select :default_time_entry_activity_id, options_from_collection_for_select(TimeEntryActivity.active.shared, :id, :name, @role.default_time_entry_activity_id), :include_blank => l(:label_none) %></p> + <% end %> + <% if @role.new_record? && @roles.any? %> <p><label for="copy_workflow_from"><%= l(:label_copy_workflow_from) %></label> <%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles, :id, :name, params[:copy_workflow_from] || @copy_from.try(:id))) %></p> diff --git a/app/views/timelog/new.js.erb b/app/views/timelog/new.js.erb index 4cba8cfe6..70b731e26 100644 --- a/app/views/timelog/new.js.erb +++ b/app/views/timelog/new.js.erb @@ -1,2 +1,2 @@ -$('#time_entry_activity_id').html('<%= escape_javascript options_for_select(activity_collection_for_select_options(@time_entry), @time_entry.activity_id) %>'); +$('#time_entry_activity_id').html('<%= escape_javascript options_for_select(activity_collection_for_select_options(@time_entry), default_activity(@time_entry)) %>'); $('#time_entry_issue').html('<%= escape_javascript link_to_issue(@time_entry.issue) if @time_entry.issue.try(:visible?) %>'); |