Update issues_form_hook_listener.rb

This commit is contained in:
2017-11-17 10:56:13 -05:00
committed by GitHub
parent b8186e4b52
commit 738cd21b1f

View File

@@ -27,6 +27,16 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
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
#check project level vehicle ownership
if context[:issue].project.vehicle
selected_vehicle = context[:issue].project.vehicle.id ? selected_vehicle.nil? : nil
end
# Load customer information
customer = Customer.find_by_id(selected_customer) if selected_customer
search_customer = f.autocomplete_field :customer, autocomplete_customer_name_customers_path, :selected => selected_customer, :update_elements => {:id => '#issue_customer_id', :value => '#issue_customer'}