mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-03 20:40:43 -04:00
Add create_issues action and route for customer appointments
This commit is contained in:
1 parent
78d1986493
commit
68425e690a
2 files changed
+14
No files matched your search
@@ -25,6 +25,19 @@ class CustomerAppointmentsController < ApplicationController
|
||||
}
|
||||
end
|
||||
|
||||
def create_issues
|
||||
@appointment = CustomerAppointment.find(params[:id])
|
||||
created_issues = @appointment.create_issues_from_labor_lines(project: @project, author: User.current)
|
||||
|
||||
if created_issues.any?
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
redirect_to project_customer_appointments_path(@project)
|
||||
else
|
||||
flash[:error] = l(:error_no_labor_lines_found)
|
||||
redirect_to customer_appointment_path(@appointment)
|
||||
end
|
||||
end
|
||||
|
||||
def index
|
||||
if params[:project_id]
|
||||
@project = Project.find(params[:project_id])
|
||||
|
||||
@@ -13,6 +13,7 @@ RedmineApp::Application.routes.draw do
|
||||
resources :customer_appointments do
|
||||
collection do
|
||||
get :customer_options
|
||||
get :create_issues
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user