GitLab ist wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht erreichbar.

Commit cf1a153c authored by jplang's avatar jplang

Bulk edit for shows activities not available for the time entry's project (#23922).

git-svn-id: https://svn.redmine.org/redmine/trunk@15953 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 55b8f4a5
......@@ -168,7 +168,7 @@ class TimelogController < ApplicationController
end
def bulk_edit
@available_activities = TimeEntryActivity.shared.active
@available_activities = @projects.map(&:activities).reduce(:&)
@custom_fields = TimeEntry.first.available_custom_fields.select {|field| field.format.bulk_edit_supported}
end
......@@ -231,7 +231,10 @@ private
end
def find_time_entries
@time_entries = TimeEntry.where(:id => params[:id] || params[:ids]).preload(:project, :user).to_a
@time_entries = TimeEntry.where(:id => params[:id] || params[:ids]).
preload(:project => :time_entry_activities).
preload(:user).to_a
raise ActiveRecord::RecordNotFound if @time_entries.empty?
raise Unauthorized unless @time_entries.all? {|t| t.editable_by?(User.current)}
@projects = @time_entries.collect(&:project).compact.uniq
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment