mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Update issues_form_hook_listener.rb
This commit is contained in:
@@ -22,17 +22,15 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
|
|||||||
def view_issues_form_details_bottom(context={})
|
def view_issues_form_details_bottom(context={})
|
||||||
f = context[:form]
|
f = context[:form]
|
||||||
|
|
||||||
|
#check project level customer/vehicle ownership first
|
||||||
|
selected_customer = context[:project].customer ? context[:project].customer.id : nil
|
||||||
|
selected_vehicle = context[:project].vehicle ? context[:project].vehicle.id : nil
|
||||||
|
|
||||||
# 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[:issue].customer ? context[:issue].customer.id : nil
|
selected_customer = context[:issue].customer ? context[:issue].customer.id : nil
|
||||||
selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
|
selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
|
||||||
selected_vehicle = context[:issue].vehicles_id ? context[:issue].vehicles_id : nil
|
selected_vehicle = context[:issue].vehicles_id ? context[:issue].vehicles_id : nil
|
||||||
|
|
||||||
#check project level customer ownership
|
|
||||||
selected_customer = context[:project].customer.id ? selected_customer.nil? : nil
|
|
||||||
|
|
||||||
#check project level vehicle ownership
|
|
||||||
selected_vehicle = context[:project].vehicle.id ? selected_vehicle.nil? : 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 => '#issue_customer_id', :value => '#issue_customer'}
|
||||||
|
|||||||
Reference in New Issue
Block a user