Fix for setting the deliverable on new issues.
This commit is contained in:
@@ -48,13 +48,21 @@ class BudgetIssueHook < Redmine::Hook::ViewListener
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def controller_issues_edit_before_save(context = {})
|
def set_deliverable_on_issue(context)
|
||||||
if context[:params] && context[:params][:issue] && context[:params][:issue][:deliverable_id].present?
|
if context[:params] && context[:params][:issue] && context[:params][:issue][:deliverable_id].present?
|
||||||
context[:issue].deliverable = Deliverable.find_by_id_and_project_id(context[:params][:issue][:deliverable_id].to_i, context[:issue].project.id)
|
context[:issue].deliverable = Deliverable.find_by_id_and_project_id(context[:params][:issue][:deliverable_id].to_i, context[:issue].project.id)
|
||||||
end
|
end
|
||||||
return ''
|
return ''
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def controller_issues_new_before_save(context = {})
|
||||||
|
set_deliverable_on_issue(context)
|
||||||
|
end
|
||||||
|
|
||||||
|
def controller_issues_edit_before_save(context = {})
|
||||||
|
set_deliverable_on_issue(context)
|
||||||
|
end
|
||||||
|
|
||||||
# Saves the Deliverable assignment to the issue
|
# Saves the Deliverable assignment to the issue
|
||||||
#
|
#
|
||||||
# Context:
|
# Context:
|
||||||
|
|||||||
Reference in New Issue
Block a user