diff --git a/app/views/qbo/_issues_show_details.html.erb b/app/views/qbo/_issues_show_details.html.erb new file mode 100644 index 0000000..a275d34 --- /dev/null +++ b/app/views/qbo/_issues_show_details.html.erb @@ -0,0 +1,35 @@ +
+
+
+
Customer:
+
<%= customer %>
+
+ +
+
Estimate:
+
<%= estimate_link %>
+
+ +
+
Invoice:
+
<%= invoice_link %>
+
+
+ +
+
+
Vehicle:
+
<%= vehicle %>
+
+ +
+
VIN:
+
<%=split_vin[0] if split_vin%><%=split_vin[1] if split_vin%>
+
+ +
+
Notes:
+
<%=notes%>
+
+
+
diff --git a/lib/issues_show_hook_listener.rb b/lib/issues_show_hook_listener.rb index d0a07e6..b3a23e1 100644 --- a/lib/issues_show_hook_listener.rb +++ b/lib/issues_show_hook_listener.rb @@ -10,11 +10,6 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener - # Additional context fields - # :issue => the issue this is edited - # :f => the form object to create additional fields - #render_on :view_issues_show_details_bottom, :partial => 'hooks/redmine_qbo/_view_issues_show_details_bottom.html.erb' - # View Issue # Display the quickbooks contact in the issue def view_issues_show_details_bottom(context={}) @@ -50,46 +45,20 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener end split_vin = vin.scan(/.{1,9}/) if vin - - return " -
- -
-
-
Customer:
-
#{customer}
-
- -
-
Estimate:
-
#{estimate_link}
-
- -
-
Invoice:
-
#{invoice_link}
-
-
- -
-
-
Vehicle:
-
#{vehicle}
-
- -
-
VIN:
-
#{split_vin[0] if split_vin}#{split_vin[1] if split_vin}
-
- -
-
Notes:
-
#{notes}
-
-
-
" + + context[:controller].send(:render_to_string, { + :partial => 'qbo/issues_show_details', + locals: { + customer: customer, + estimate_link: estimate_link, + invoice_link: invoice_link, + vehicle: vehicle, + split_vin: split_vin, + notes: notes + } + }) end - + def view_issues_show_description_bottom(context={}) bill_button = button_to "Bill Time", "#{Redmine::Utils::relative_url_root}/qbo/bill/#{context[:issue].id}", method: :get if User.current.admin? share_button = button_to "Share", "#{Redmine::Utils::relative_url_root}/customers/view/#{context[:issue].share_token.token}", method: :get if User.current.logged?