mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update projects_form_hook_listener.rb
This commit is contained in:
@@ -23,13 +23,13 @@ class ProjectsFormHookListener < Redmine::Hook::ViewListener
|
|||||||
f = context[:form]
|
f = context[:form]
|
||||||
|
|
||||||
# Check to see if there is a quickbooks user attached to the issue
|
# Check to see if there is a quickbooks user attached to the issue
|
||||||
selected_customer = context[:project].customer ? context[:project].customer.id : nil
|
selected_customer = context[:project].customers_id ? context[:project].customers_id : nil
|
||||||
selected_vehicle = context[:project].vehicles_id ? context[:project].vehicles_id : nil
|
selected_vehicle = context[:project].vehicles_id ? context[:project].vehicles_id : nil
|
||||||
|
|
||||||
# Load customer information
|
# Load customer information
|
||||||
customer = Customer.find_by_id(selected_customer) if selected_customer
|
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'}
|
search_customer = f.autocomplete_field :customer, autocomplete_customer_name_customers_path, :selected => selected_customer, :update_elements => {:id => '#project_customer_id', :value => '#project_customer'}
|
||||||
customer_id = f.hidden_field :customer_id, :id => "issue_customer_id"
|
customer_id = f.hidden_field :customers_id, :id => "project_customer_id"
|
||||||
|
|
||||||
if context[:project].customer
|
if context[:project].customer
|
||||||
vehicles = customer.vehicles.pluck(:name, :id).sort!
|
vehicles = customer.vehicles.pluck(:name, :id).sort!
|
||||||
|
|||||||
Reference in New Issue
Block a user