mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-02-13 17:13:59 -05:00
Use symbols
This commit is contained in:
@@ -36,7 +36,7 @@ class EstimateController < ApplicationController
|
|||||||
estimate = get_estimate
|
estimate = get_estimate
|
||||||
|
|
||||||
begin
|
begin
|
||||||
send_data estimate.pdf, filename: "estimate #{estimate.doc_number}.pdf", disposition: 'inline', type: "application/pdf"
|
send_data estimate.pdf, filename: "estimate #{estimate.doc_number}.pdf", disposition: :inline, type: "application/pdf"
|
||||||
rescue
|
rescue
|
||||||
redirect_to :back, flash: { error: "Estimate not found" }
|
redirect_to :back, flash: { error: "Estimate not found" }
|
||||||
end
|
end
|
||||||
@@ -49,7 +49,7 @@ class EstimateController < ApplicationController
|
|||||||
estimate = get_estimate
|
estimate = get_estimate
|
||||||
|
|
||||||
begin
|
begin
|
||||||
send_data estimate.pdf, filename: "estimate #{estimate.doc_number}.pdf", disposition: 'inline', type: "application/pdf"
|
send_data estimate.pdf, filename: "estimate #{estimate.doc_number}.pdf", disposition: :inline, type: "application/pdf"
|
||||||
rescue
|
rescue
|
||||||
redirect_to :back, flash: { error: "Estimate not found" }
|
redirect_to :back, flash: { error: "Estimate not found" }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class InvoiceController < ApplicationController
|
|||||||
ref = invoice.doc_number
|
ref = invoice.doc_number
|
||||||
end
|
end
|
||||||
|
|
||||||
send_data @pdf, filename: "invoice #{ref}.pdf", disposition: 'inline', type: "application/pdf"
|
send_data @pdf, filename: "invoice #{ref}.pdf", disposition: :inline, type: "application/pdf"
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
redirect_to :back, flash: { error: "Invoice not found" }
|
redirect_to :back, flash: { error: "Invoice not found" }
|
||||||
|
|||||||
@@ -92,10 +92,10 @@ class QboController < ApplicationController
|
|||||||
data = params.as_json
|
data = params.as_json
|
||||||
end
|
end
|
||||||
# Process the information
|
# Process the information
|
||||||
entities = data['eventNotifications'][0]['dataChangeEvent']['entities']
|
entities = data['eventNotifications'][0]['dataChangeEvent'][:entities]
|
||||||
entities.each do |entity|
|
entities.each do |entity|
|
||||||
id = entity['id'].to_i
|
id = entity[:id].to_i
|
||||||
name = entity['name']
|
name = entity[:name]
|
||||||
|
|
||||||
logger.info "Casting #{name.constantize} to obj"
|
logger.info "Casting #{name.constantize} to obj"
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ class QboController < ApplicationController
|
|||||||
obj.destroy(entity['deletedId']) if entity['deletedId']
|
obj.destroy(entity['deletedId']) if entity['deletedId']
|
||||||
|
|
||||||
#Check to see if we are deleting a record
|
#Check to see if we are deleting a record
|
||||||
if entity['operation'].eql? "Delete"
|
if entity[:operation].eql? "Delete"
|
||||||
obj.destroy(id)
|
obj.destroy(id)
|
||||||
#if not then update!
|
#if not then update!
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ module QuickbooksOauth
|
|||||||
oauth_consumer_secret = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret']
|
oauth_consumer_secret = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret']
|
||||||
|
|
||||||
# Are we are playing in the sandbox?
|
# Are we are playing in the sandbox?
|
||||||
Quickbooks.sandbox_mode = Setting.plugin_redmine_qbo['sandbox'] ? true : false
|
Quickbooks.sandbox_mode = Setting.plugin_redmine_qbo[:sandbox] ? true : false
|
||||||
logger.info "Sandbox mode: #{Quickbooks.sandbox_mode}"
|
logger.info "Sandbox mode: #{Quickbooks.sandbox_mode}"
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<%=t(:field_notes)%>:
|
<%=t(:field_notes)%>:
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<p>
|
<p>
|
||||||
<%= content_tag 'span', id: "issue_description_and_toolbar" do %>
|
<%= content_tag :span, id: "issue_description_and_toolbar" do %>
|
||||||
<%= f.text_area :notes,
|
<%= f.text_area :notes,
|
||||||
cols: 60,
|
cols: 60,
|
||||||
rows: 10,
|
rows: 10,
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
no_label: true %>
|
no_label: true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<%= wikitoolbar_for 'issue_description' %>
|
<%= wikitoolbar_for :issue_description %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<h2><%=t(:field_customer)%> #<%= @customer.id %> - <%= link_to @customer.to_s, "https://#{Setting.plugin_redmine_qbo['sandbox'] ? "sandbox" : "app"}.qbo.intuit.com/app/customerdetail?nameId=#{@customer.id}", target: :_blank %> </h2>
|
<h2><%=t(:field_customer)%> #<%= @customer.id %> - <%= link_to @customer.to_s, "https://#{Setting.plugin_redmine_qbo[:sandbox] ? "sandbox" : "app"}.qbo.intuit.com/app/customerdetail?nameId=#{@customer.id}", target: :_blank %> </h2>
|
||||||
<div class="issue">
|
<div class="issue">
|
||||||
|
|
||||||
<div class="splitcontent">
|
<div class="splitcontent">
|
||||||
|
|||||||
@@ -19,27 +19,27 @@
|
|||||||
|
|
||||||
<div class="attributes">
|
<div class="attributes">
|
||||||
<%= issue_fields_rows do |rows|
|
<%= issue_fields_rows do |rows|
|
||||||
rows.left l(:field_status), @issue.status.name, class: 'status'
|
rows.left l(:field_status), @issue.status.name, class: :status
|
||||||
rows.left l(:field_priority), @issue.priority.name, class: 'priority'
|
rows.left l(:field_priority), @issue.priority.name, class: :priority
|
||||||
# unless @issue.disabled_core_fields.include?('assigned_to_id')
|
# unless @issue.disabled_core_fields.include?(:assigned_to_id)
|
||||||
# rows.left l(:field_assigned_to), avatar(@issue.assigned_to, size: "14").to_s.html_safe + (@issue.assigned_to ? @issue.assigned_to : "-"), class: 'assigned-to'
|
# rows.left l(:field_assigned_to), avatar(@issue.assigned_to, size: "14").to_s.html_safe + (@issue.assigned_to ? @issue.assigned_to : "-"), class: 'assigned-to'
|
||||||
# end
|
# end
|
||||||
unless @issue.disabled_core_fields.include?('category_id') || (@issue.category.nil? && @issue.project.issue_categories.none?)
|
unless @issue.disabled_core_fields.include?(:category_id) || (@issue.category.nil? && @issue.project.issue_categories.none?)
|
||||||
rows.left l(:field_category), (@issue.category ? @issue.category.name : "-"), class: 'category'
|
rows.left l(:field_category), (@issue.category ? @issue.category.name : "-"), class: :category
|
||||||
end
|
end
|
||||||
unless @issue.disabled_core_fields.include?('fixed_version_id') || (@issue.fixed_version.nil? && @issue.assignable_versions.none?)
|
unless @issue.disabled_core_fields.include?(:fixed_version_id) || (@issue.fixed_version.nil? && @issue.assignable_versions.none?)
|
||||||
rows.left l(:field_fixed_version), (@issue.fixed_version ? @issue.fixed_version : "-"), class: 'fixed-version'
|
rows.left l(:field_fixed_version), (@issue.fixed_version ? @issue.fixed_version : "-"), class: 'fixed-version'
|
||||||
end
|
end
|
||||||
unless @issue.disabled_core_fields.include?('start_date')
|
unless @issue.disabled_core_fields.include?(:start_date)
|
||||||
rows.right l(:field_start_date), format_date(@issue.start_date), class: 'start-date'
|
rows.right l(:field_start_date), format_date(@issue.start_date), class: 'start-date'
|
||||||
end
|
end
|
||||||
unless @issue.disabled_core_fields.include?('due_date')
|
unless @issue.disabled_core_fields.include?(:due_date)
|
||||||
rows.right l(:field_due_date), format_date(@issue.due_date), class: 'due-date'
|
rows.right l(:field_due_date), format_date(@issue.due_date), class: 'due-date'
|
||||||
end
|
end
|
||||||
unless @issue.disabled_core_fields.include?('done_ratio')
|
unless @issue.disabled_core_fields.include?(:done_ratio)
|
||||||
rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, legend: "#{@issue.done_ratio}%"), class: 'progress'
|
rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, legend: "#{@issue.done_ratio}%"), class: :progress
|
||||||
end
|
end
|
||||||
unless @issue.disabled_core_fields.include?('estimated_hours')
|
unless @issue.disabled_core_fields.include?(:estimated_hours)
|
||||||
if @issue.estimated_hours.present? || @issue.total_estimated_hours.to_f > 0
|
if @issue.estimated_hours.present? || @issue.total_estimated_hours.to_f > 0
|
||||||
rows.right l(:field_estimated_hours), issue_estimated_hours_details(@issue), class: 'estimated-hours'
|
rows.right l(:field_estimated_hours), issue_estimated_hours_details(@issue), class: 'estimated-hours'
|
||||||
end
|
end
|
||||||
@@ -59,7 +59,7 @@ end %>
|
|||||||
<% if @issue.description? %>
|
<% if @issue.description? %>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<div class="contextual">
|
<div class="contextual">
|
||||||
<%= link_to l(:button_quote), quoted_issue_path(@issue), remote: true, method: 'post', class: 'icon icon-comment' if @issue.notes_addable? %>
|
<%= link_to l(:button_quote), quoted_issue_path(@issue), remote: true, method: :post, class: 'icon icon-comment' if @issue.notes_addable? %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><strong><%=l(:field_description)%></strong></p>
|
<p><strong><%=l(:field_description)%></strong></p>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% for issue in issues %>
|
<% for issue in issues %>
|
||||||
<tr id="issue-<%= h(issue.id) %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
|
<tr id="issue-<%= h(issue.id) %>" class="hascontextmenu <%= cycle(:odd, :even) %> <%= issue.css_classes %>">
|
||||||
<td class="id">
|
<td class="id">
|
||||||
<%= check_box_tag("ids[]", issue.id, false, style: 'display:none;', id: nil) %>
|
<%= check_box_tag("ids[]", issue.id, false, style: 'display:none;', id: nil) %>
|
||||||
<%= link_to(issue.id, issue_path(issue)) %>
|
<%= link_to(issue.id, issue_path(issue)) %>
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_sandbox)%></th>
|
<th><%=t(:label_sandbox)%></th>
|
||||||
<td>
|
<td>
|
||||||
<%= check_box_tag 'settings[sandbox]', @settings['sandbox'], @settings['sandbox'] %>
|
<%= check_box_tag 'settings[sandbox]', @settings[:sandbox], @settings[:sandbox] %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ module Hooks
|
|||||||
|
|
||||||
# Load the javascript to support the autocomplete forms
|
# Load the javascript to support the autocomplete forms
|
||||||
def view_layouts_base_html_head(context = {})
|
def view_layouts_base_html_head(context = {})
|
||||||
js = javascript_include_tag 'application.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 'autocomplete-rails.js', plugin: :redmine_qbo
|
||||||
js += javascript_include_tag 'checkbox_controller.js', plugin: 'redmine_qbo'
|
js += javascript_include_tag 'checkbox_controller.js', plugin: :redmine_qbo
|
||||||
return js
|
return js
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ module Patches
|
|||||||
left << [l(:field_status), issue.status]
|
left << [l(:field_status), issue.status]
|
||||||
left << [l(:field_priority), issue.priority]
|
left << [l(:field_priority), issue.priority]
|
||||||
left << [l(:field_customer), customer]
|
left << [l(:field_customer), customer]
|
||||||
left << [l(:field_assigned_to), issue.assigned_to] unless issue.disabled_core_fields.include?('assigned_to_id')
|
left << [l(:field_assigned_to), issue.assigned_to] unless issue.disabled_core_fields.include?(:assigned_to_id)
|
||||||
#left << [l(:field_category), issue.category] unless issue.disabled_core_fields.include?('category_id')
|
#left << [l(:field_category), issue.category] unless issue.disabled_core_fields.include?(:category_id)
|
||||||
#left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?('fixed_version_id')
|
#left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?(:fixed_version_id)
|
||||||
|
|
||||||
logger.debug "Calling :pdf_left hook"
|
logger.debug "Calling :pdf_left hook"
|
||||||
left_hook_output = Redmine::Hook.call_hook :pdf_left, { issue: issue }
|
left_hook_output = Redmine::Hook.call_hook :pdf_left, { issue: issue }
|
||||||
@@ -67,10 +67,10 @@ module Patches
|
|||||||
end
|
end
|
||||||
|
|
||||||
right = []
|
right = []
|
||||||
right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?('start_date')
|
right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?(:start_date)
|
||||||
right << [l(:field_due_date), format_date(issue.due_date)] unless issue.disabled_core_fields.include?('due_date')
|
right << [l(:field_due_date), format_date(issue.due_date)] unless issue.disabled_core_fields.include?(:due_date)
|
||||||
right << [l(:field_done_ratio), "#{issue.done_ratio}%"] unless issue.disabled_core_fields.include?('done_ratio')
|
right << [l(:field_done_ratio), "#{issue.done_ratio}%"] unless issue.disabled_core_fields.include?(:done_ratio)
|
||||||
right << [l(:field_estimated_hours), l_hours(issue.estimated_hours)] unless issue.disabled_core_fields.include?('estimated_hours')
|
right << [l(:field_estimated_hours), l_hours(issue.estimated_hours)] unless issue.disabled_core_fields.include?(:estimated_hours)
|
||||||
right << [l(:label_spent_time), l_hours(issue.total_spent_hours)] if User.current.allowed_to?(:view_time_entries, issue.project)
|
right << [l(:label_spent_time), l_hours(issue.total_spent_hours)] if User.current.allowed_to?(:view_time_entries, issue.project)
|
||||||
|
|
||||||
logger.debug "Calling :pdf_right hook"
|
logger.debug "Calling :pdf_right hook"
|
||||||
|
|||||||
Reference in New Issue
Block a user