mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-02-13 09:13:58 -05:00
loose the hash rocket, use symbol keys
This commit is contained in:
@@ -24,27 +24,27 @@ module Hooks
|
||||
# onchange event will update the hidden customer_id field
|
||||
search_customer = f.autocomplete_field :customer,
|
||||
autocomplete_customer_name_customers_path,
|
||||
:selected => issue.customer,
|
||||
:update_elements => {
|
||||
:id => '#issue_customer_id',
|
||||
:value => '#issue_customer'
|
||||
selected: issue.customer,
|
||||
update_elements: {
|
||||
id: '#issue_customer_id',
|
||||
value: '#issue_customer'
|
||||
}
|
||||
|
||||
# This hidden field is used for the customer ID for the issue
|
||||
# the onchange event will reload the issue form via ajax to update the available estimates
|
||||
customer_id = f.hidden_field :customer_id,
|
||||
:id => "issue_customer_id",
|
||||
:onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(issue.project, issue)}', this)".html_safe
|
||||
id: "issue_customer_id",
|
||||
onchange: "updateIssueFrom('#{escape_javascript update_issue_form_path(issue.project, issue)}', this)".html_safe
|
||||
|
||||
# Generate the drop down list of quickbooks estimates owned by the selected customer
|
||||
select_estimate = f.select :estimate_id,
|
||||
issue.customer ? issue.customer.estimates.pluck(:doc_number, :id).sort! {|x, y| y <=> x} : [],
|
||||
:selected => issue.estimate,
|
||||
selected: issue.estimate,
|
||||
include_blank: true
|
||||
|
||||
# Pass all prebuilt form components to our partial
|
||||
context[:controller].send(:render_to_string, {
|
||||
:partial => 'issues/form_hook',
|
||||
partial: 'issues/form_hook',
|
||||
locals: {
|
||||
search_customer: search_customer,
|
||||
customer_id: customer_id,
|
||||
|
||||
@@ -26,7 +26,7 @@ module Hooks
|
||||
end
|
||||
|
||||
context[:controller].send(:render_to_string, {
|
||||
:partial => 'issues/show_details',
|
||||
partial: 'issues/show_details',
|
||||
locals: {
|
||||
customer: issue.customer ? link_to(issue.customer): nill,
|
||||
estimate_link: issue.estimate ? link_to(issue.estimate, issue.estimate, target: :_blank) : nil,
|
||||
|
||||
@@ -22,7 +22,7 @@ module Hooks
|
||||
@selected = context[:user].employee.id if context[:user].employee
|
||||
|
||||
# Generate the drop down list of quickbooks contacts
|
||||
return "<p>#{context[:form].select :employee_id, Employee.all.pluck(:name, :id), :selected => @selected, include_blank: true}</p>"
|
||||
return "<p>#{context[:form].select :employee_id, Employee.all.pluck(:name, :id), selected: @selected, include_blank: true}</p>"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ module Hooks
|
||||
|
||||
class ViewHookListener < Redmine::Hook::ViewListener
|
||||
|
||||
render_on :view_layouts_base_sidebar, :partial => "qbo/sidebar"
|
||||
render_on :view_layouts_base_sidebar, partial: "qbo/sidebar"
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ module Hooks
|
||||
|
||||
# Load the javascript to support the autocomplete forms
|
||||
def view_layouts_base_html_head(context = {})
|
||||
js = javascript_include_tag 'application.js', :plugin => 'redmine_qbo'
|
||||
js += javascript_include_tag 'autocomplete-rails.js', :plugin => 'redmine_qbo'
|
||||
js += javascript_include_tag 'checkbox_controller.js', :plugin => 'redmine_qbo'
|
||||
js = javascript_include_tag 'application.js', plugin: 'redmine_qbo'
|
||||
js += javascript_include_tag 'autocomplete-rails.js', plugin: 'redmine_qbo'
|
||||
js += javascript_include_tag 'checkbox_controller.js', plugin: 'redmine_qbo'
|
||||
return js
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user