mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-11-17 18:40:36 -05:00
The appointment page's Add Vehicle link (shown when the appointment has none) now carries the appointment and a back_url. Creating the vehicle calls a new :controller_vehicles_new_after_save hook; this plugin's listener sets the vehicle on that appointment (same customer, no vehicle yet, user may edit appointments) and the form redirects back to the appointment. The calendar plugin is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
15 lines
681 B
ERB
15 lines
681 B
ERB
<%# On an appointment without a vehicle: add one for the customer; once created, it's set on this appointment
|
|
and you're brought back here (Vehicles::Hooks::AppointmentVehicleHookListener) %>
|
|
<% if User.current.allowed_to?(:add_vehicles, nil, global: true) %>
|
|
<% if appointment.customer.present? %>
|
|
<% unless appointment.vehicle.present? %>
|
|
<p>
|
|
<%= link_to new_vehicle_path(customer_id: appointment.customer_id, appointment_id: appointment.id,
|
|
back_url: customer_appointment_path(appointment)), class: 'icon icon-add' do %>
|
|
<%= l(:label_add_vehicle) %>
|
|
<% end %>
|
|
</p>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|