From 0468af9e53fa913e99ee681bb8456a7f2bf7453c Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Sun, 24 Apr 2016 12:03:43 -0400 Subject: [PATCH] Display vheicle info in issues --- app/views/vehicles/_form.html.erb | 2 +- lib/issues_show_hook_listener.rb | 77 ++++++++++++++++++++++--------- 2 files changed, 57 insertions(+), 22 deletions(-) diff --git a/app/views/vehicles/_form.html.erb b/app/views/vehicles/_form.html.erb index 7fcff15..4fbd23d 100644 --- a/app/views/vehicles/_form.html.erb +++ b/app/views/vehicles/_form.html.erb @@ -41,7 +41,7 @@
Notes:
- <%= f.text_area :notes, :rows => 6%> + <%= f.text_area :notes, :rows => 6, :class => 'wiki-edit', :accesskey => accesskey(:edit), :cols => 60%>
diff --git a/lib/issues_show_hook_listener.rb b/lib/issues_show_hook_listener.rb index 123ba55..0f5f4ab 100644 --- a/lib/issues_show_hook_listener.rb +++ b/lib/issues_show_hook_listener.rb @@ -38,27 +38,62 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener invoice_link = link_to invoice, "#{Redmine::Utils::relative_url_root }/qbo/invoice/#{issue.qbo_invoice.id}", :target => "_blank" end - return "
-
-
Customer:
-
#{customer}
-
- -
-
Item:
-
#{item}
-
- -
-
Estimate:
-
#{estimate_link}
-
- -
-
Invoice:
-
#{invoice_link}
-
-
" + v = Vehicle.find_by_id(issue.vehicles_id) + vehicle = v ? v.to_s : nil + vin = v ? v.vin : nil + notes = v ? v.notes : nil + + + return " +
+ +
+ +
+
Customer:
+
#{customer}
+
+ +
+
Item:
+
#{item}
+
+ +
+
Estimate:
+
#{estimate_link}
+
+ +
+
Invoice:
+
#{invoice_link}
+
+ +
+ +
+ +
+
Vehicle:
+
#{vehicle}
+
+ +
+
VIN:
+
#{vin}
+
+ +
+
Vehicle Notes:
+
#{notes}
+
+ +
+ +
+
+ +
" end end