Did things

This commit is contained in:
2017-11-19 22:14:40 -05:00
parent 299a28a0d2
commit bd03e3ac32
2 changed files with 2 additions and 11 deletions

View File

@@ -1,5 +0,0 @@
class ControllerIssuesListener.rb < Redmine::Hook::ControllerListener
def controller_issues_new_before_save(context={})
context[:issue].project = Project.find_by identifier: context[:params][:project]
end
end

View File

@@ -28,14 +28,10 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
selected_vehicle = context[:issue].vehicles_id ? context[:issue].vehicles_id : nil
#check project level customer ownership
if context[:issue].project.customer
selected_customer = context[:issue].project.customer.id ? selected_customer.nil? : nil
end
selected_customer = context[:project].customer.id ? selected_customer.nil? : nil
#check project level vehicle ownership
if context[:issue].project.vehicle
selected_vehicle = context[:issue].project.vehicle.id ? selected_vehicle.nil? : nil
end
selected_vehicle = context[:project].vehicle.id ? selected_vehicle.nil? : nil
# Load customer information
customer = Customer.find_by_id(selected_customer) if selected_customer