In the order cycle pages (both create and edit, both simple and normal), add OC coordinator to schedules request to the server and make the controller filter schedules of order cycles coordinated by that enterprise id.

This commit is contained in:
luisramos0
2019-06-09 23:15:44 +01:00
parent 568e3003ba
commit 6cf705ea55
12 changed files with 41 additions and 12 deletions

View File

@@ -31,7 +31,11 @@ module Admin
def collection
return Schedule.where("1=0") unless json_request?
permissions.visible_schedules
if params[:enterprise_id]
permissions.visible_schedules.select { |schedule| schedule.coordinators.map(&:id).include? params[:enterprise_id].to_i }
else
permissions.visible_schedules
end
end
def collection_actions