diff options
| -rw-r--r-- | app/controllers/vehicle_journeys_controller.rb | 4 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/index.html.slim | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb index 14795227c..e532712d2 100644 --- a/app/controllers/vehicle_journeys_controller.rb +++ b/app/controllers/vehicle_journeys_controller.rb @@ -155,6 +155,10 @@ class VehicleJourneysController < ChouetteController private def load_custom_fields @custom_fields = referential.workgroup&.custom_fields_definitions || {} + + @extra_headers = Rails.application.config.vehicle_journeys_extra_headers.dup.delete_if do |header| + header[:type] == :custom_field and not @custom_fields.has_key?(header[:name].to_s) + end end def map_stop_points points diff --git a/app/views/vehicle_journeys/index.html.slim b/app/views/vehicle_journeys/index.html.slim index 5606bc055..d23c61394 100644 --- a/app/views/vehicle_journeys/index.html.slim +++ b/app/views/vehicle_journeys/index.html.slim @@ -29,7 +29,7 @@ | window.features = #{raw @features}; | window.all_missions = #{(@all_missions.to_json).html_safe}; | window.custom_fields = #{(@custom_fields.to_json).html_safe}; - | window.extra_headers = #{Rails.application.config.vehicle_journeys_extra_headers.to_json.html_safe}; + | window.extra_headers = #{(@extra_headers.to_json).html_safe}; // | window.I18n = #{(I18n.backend.send(:translations).to_json).html_safe}; - if has_feature?(:vehicle_journeys_return_route) |
