Don't allow reassigning reported hours to the project if issue is a required field for time logs (#28110).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@17199 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2018-02-18 04:24:05 +00:00
parent 241e4cbb68
commit a500e8fafc
3 changed files with 51 additions and 0 deletions

View File

@@ -367,7 +367,12 @@ class IssuesController < ApplicationController
when 'destroy'
# nothing to do
when 'nullify'
if Setting.timelog_required_fields.include?('issue_id')
flash.now[:error] = l(:field_issue) + " " + ::I18n.t('activerecord.errors.messages.blank')
return
else
time_entries.update_all(:issue_id => nil)
end
when 'reassign'
reassign_to = @project && @project.issues.find_by_id(params[:reassign_to_id])
if reassign_to.nil?