loose the hash rocket, use symbol keys

This commit is contained in:
2026-01-29 22:30:59 -05:00
parent f24128ef75
commit b80e1d4e28
44 changed files with 155 additions and 155 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -55,8 +55,8 @@ module Patches
# Prepare to create a new Time Activity
qbo = Qbo.first
qbo.perform_authenticated_request do |access_token|
time_service = Quickbooks::Service::TimeActivity.new(:company_id => qbo.realm_id, :access_token => access_token)
item_service = Quickbooks::Service::Item.new(:company_id => qbo.realm_id, :access_token => access_token)
time_service = Quickbooks::Service::TimeActivity.new(company_id: qbo.realm_id, access_token: access_token)
item_service = Quickbooks::Service::Item.new(company_id: qbo.realm_id, access_token: access_token)
time_entry = Quickbooks::Model::TimeActivity.new
# Lets total up each activity before billing.

View File

@@ -143,10 +143,10 @@ module Patches
# Set resize image scale
pdf.set_image_scale(1.6)
text = textilizable(issue, :description,
:only_path => false,
:edit_section_links => false,
:headings => false,
:inline_attachments => false
only_path: false,
edit_section_links: false,
headings: false,
inline_attachments: false
)
pdf.RDMwriteFormattedCell(35+155, 5, '', '', text, issue.attachments, "LRB")
@@ -233,10 +233,10 @@ module Patches
pdf.ln unless journal.details.empty?
pdf.SetFontStyle('',8)
text = textilizable(journal, :notes,
:only_path => false,
:edit_section_links => false,
:headings => false,
:inline_attachments => false
only_path: false,
edit_section_links: false,
headings: false,
inline_attachments: false
)
pdf.RDMwriteFormattedCell(190,5,'','', text, issue.attachments, "")
end

View File

@@ -18,15 +18,15 @@ module Patches
def available_columns
unless @available_columns
@available_columns = self.class.available_columns.dup
@available_columns << QueryColumn.new(:customer, :sortable => "#{Issue.table_name}.customer_id", :groupable => true, :caption => :field_customer)
@available_columns << QueryColumn.new(:billed, :sortable => "#{TimeEntry.table_name}.billed", :groupable => true, :caption => :field_billed)
@available_columns << QueryColumn.new(:customer, sortable: "#{Issue.table_name}.customer_id", groupable: true, caption: :field_customer)
@available_columns << QueryColumn.new(:billed, sortable: "#{TimeEntry.table_name}.billed", groupable: true, caption: :field_billed)
end
super
end
# Add customers to filters
def initialize_available_filters
#add_available_filter "customer", :type => :text
#add_available_filter "customer", type: :text
super
end

View File

@@ -18,14 +18,14 @@ module Patches
def available_columns
unless @available_columns
@available_columns = self.class.available_columns.dup
@available_columns << QueryColumn.new(:billed, :sortable => "#{TimeEntry.table_name}.name", :groupable => true, :caption => :field_billed)
@available_columns << QueryColumn.new(:billed, sortable: "#{TimeEntry.table_name}.name", groupable: true, caption: :field_billed)
end
super
end
# Add QBO options to the filter
def initialize_available_filters
add_available_filter "billed", :type => :boolean
add_available_filter "billed", type: :boolean
super
end