aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Florisson2014-12-16 22:05:34 +0100
committerMarc Florisson2014-12-16 22:05:34 +0100
commit34e72cf4d924bcc38499fea3e670373d8600b8f4 (patch)
treef9d6caf015e974cdc664a7b9b7440d0d46d889a2
parent40a48cd6db6e95d0e25d94b12bbed553060c381c (diff)
parentfca502ad91536c6cc2959d5a9e890f1c962193b2 (diff)
downloadchouette-core-34e72cf4d924bcc38499fea3e670373d8600b8f4.tar.bz2
Merge branch 'V2_5' of github.com:afimb/chouette2 into V2_5
-rw-r--r--README.md2
-rw-r--r--app/controllers/compliance_check_results_controller.rb9
-rw-r--r--app/controllers/compliance_check_tasks_controller.rb7
-rw-r--r--app/exporters/chouette/hub/city_code_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/commercial_stop_area_exporter.rb6
-rw-r--r--app/exporters/chouette/hub/company_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/connection_link_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/direction_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/exporter.rb1
-rw-r--r--app/exporters/chouette/hub/group_of_lines_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/itl_exporter.rb65
-rw-r--r--app/exporters/chouette/hub/journey_pattern_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/line_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/network_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/physical_stop_area_exporter.rb5
-rw-r--r--app/exporters/chouette/hub/route_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/time_table_exporter.rb25
-rw-r--r--app/exporters/chouette/hub/transport_mode_exporter.rb2
-rw-r--r--app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb4
-rw-r--r--app/exporters/chouette/hub/vehicle_journey_exporter.rb16
-rw-r--r--app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb2
-rw-r--r--app/models/compliance_check_task.rb5
-rw-r--r--app/models/compliance_check_task_export.rb52
-rw-r--r--app/views/api/hub/arrets_generiques.hub.erb2
-rw-r--r--app/views/api/hub/arrets_physiques.hub.erb2
-rw-r--r--app/views/api/hub/chemins.hub.erb2
-rw-r--r--app/views/api/hub/communes.hub.erb2
-rw-r--r--app/views/api/hub/directions.hub.erb2
-rw-r--r--app/views/api/hub/groupe_de_lignes.hub.erb2
-rw-r--r--app/views/api/hub/horaires.hub.erb2
-rw-r--r--app/views/api/hub/itls.hub.erb1
-rw-r--r--app/views/api/hub/lignes.hub.erb2
-rw-r--r--app/views/api/hub/periodes.hub.erb2
-rw-r--r--app/views/api/hub/reseaux.hub.erb2
-rw-r--r--app/views/api/hub/transporteurs.hub.erb2
-rw-r--r--app/views/compliance_check_tasks/detailed_errors_index.csv.erb2
-rw-r--r--app/views/compliance_check_tasks/show.html.erb1
-rw-r--r--app/views/compliance_check_tasks/summary_errors_index.csv.erb3
-rw-r--r--app/views/connection_links/show.html.erb6
-rw-r--r--app/views/group_of_lines/_form.erb1
-rw-r--r--app/views/group_of_lines/show.html.erb4
-rw-r--r--config/deploy/private.rb3
-rw-r--r--config/deploy/production.rb2
-rw-r--r--config/deploy/sismo.rb3
-rw-r--r--config/locales/compliance_check_results.yml16
-rw-r--r--config/locales/compliance_check_tasks.yml2
-rw-r--r--config/locales/connection_link_types.yml2
-rw-r--r--config/locales/exports.yml2
-rw-r--r--config/locales/group_of_lines.yml2
-rw-r--r--config/routes.rb11
-rw-r--r--db/migrate/20141216085004_add_registration_number_to_group_of_lines.ninoxe_engine.rb6
-rw-r--r--db/schema.rb5
52 files changed, 246 insertions, 67 deletions
diff --git a/README.md b/README.md
index 58b745561..b23eb3e2e 100644
--- a/README.md
+++ b/README.md
@@ -57,7 +57,7 @@ sudo apt-get install make
Installation
------------
-On debian, chouette can also be installed as package : see [debian packages](http://packages.chouette.cityway.fr/debian/chouette)
+On debian, chouette can also be installed as a package : see [debian packages](http://packages.chouette.cityway.fr/debian/chouette)
Install chouette-gui-command to import, export and validate transport offer,
Assume Linux user is myuser and its group mygroup (that user is the one who starts Rails server)
diff --git a/app/controllers/compliance_check_results_controller.rb b/app/controllers/compliance_check_results_controller.rb
index a4ef40509..a39c79ea7 100644
--- a/app/controllers/compliance_check_results_controller.rb
+++ b/app/controllers/compliance_check_results_controller.rb
@@ -1,22 +1,23 @@
class ComplianceCheckResultsController < ChouetteController
+
respond_to :json
respond_to :js, :only => :index
belongs_to :compliance_check_task
- def index
+ def index
index! do |format|
format.html { render :layout => false }
end
end
-
+
def collection
wheres = [:status, :severity].map{|key| params.has_key?(key) ? {key => params[key]} : {} }\
.inject({}){|hash, injected| hash.merge!(injected)}
@compliance_check_results ||= end_of_association_chain.where(wheres).order(:rule_code)
end
-
+
def rule_parameter_set
@rule_parameter_set = RuleParameterSet.new.tap { |rps| rps.parameters = resource.parameter_set }
end
-
+
end
diff --git a/app/controllers/compliance_check_tasks_controller.rb b/app/controllers/compliance_check_tasks_controller.rb
index d28ca34ae..773ea1ed7 100644
--- a/app/controllers/compliance_check_tasks_controller.rb
+++ b/app/controllers/compliance_check_tasks_controller.rb
@@ -2,6 +2,7 @@ class ComplianceCheckTasksController < ChouetteController
defaults :resource_class => ComplianceCheckTask
respond_to :html, :js
+ respond_to :zip, :only => :export
belongs_to :referential
@@ -25,6 +26,12 @@ class ComplianceCheckTasksController < ChouetteController
success.html { flash[:notice] = I18n.t('compliance_check_tasks.new.flash'); redirect_to referential_compliance_check_tasks_path(@referential) }
end
end
+
+ def export
+ respond_to do |format|
+ format.zip { send_file ComplianceCheckTaskExport.new(compliance_check_task, request).export, :type => :zip }
+ end
+ end
protected
diff --git a/app/exporters/chouette/hub/city_code_exporter.rb b/app/exporters/chouette/hub/city_code_exporter.rb
index 1279313eb..ee1180064 100644
--- a/app/exporters/chouette/hub/city_code_exporter.rb
+++ b/app/exporters/chouette/hub/city_code_exporter.rb
@@ -27,7 +27,7 @@ class Chouette::Hub::CityCodeExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("COMMUNES\u000D\u000A") if f.size == 0
f.write(render)
end
diff --git a/app/exporters/chouette/hub/commercial_stop_area_exporter.rb b/app/exporters/chouette/hub/commercial_stop_area_exporter.rb
index be4b667e5..87a41b8ee 100644
--- a/app/exporters/chouette/hub/commercial_stop_area_exporter.rb
+++ b/app/exporters/chouette/hub/commercial_stop_area_exporter.rb
@@ -7,7 +7,9 @@ class Chouette::Hub::CommercialStopAreaExporter
@directory = directory
@template = File.open('app/views/api/hub/arrets_generiques.hub.erb' ){ |f| f.read }
@type = "ONNNNNNNNNNNNNNNNN"
-
+ if @stop_area.mobility_restricted_suitability
+ @type = "ONNNNNNNNNNNNONNNN"
+ end
@stop_area.referential.projection_type = "27562"
wgs84 = '+proj=lonlat +datum=WGS84 +ellps=WGS84'
@@ -35,7 +37,7 @@ class Chouette::Hub::CommercialStopAreaExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("ARRET\u000D\u000A") if f.size == 0
f.write(render)
end if stop_area.present?
diff --git a/app/exporters/chouette/hub/company_exporter.rb b/app/exporters/chouette/hub/company_exporter.rb
index 142853b22..e5ba0549c 100644
--- a/app/exporters/chouette/hub/company_exporter.rb
+++ b/app/exporters/chouette/hub/company_exporter.rb
@@ -26,7 +26,7 @@ class Chouette::Hub::CompanyExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("TRANSPORTEUR\u000D\u000A") if f.size == 0
f.write(render)
end if company.present?
diff --git a/app/exporters/chouette/hub/connection_link_exporter.rb b/app/exporters/chouette/hub/connection_link_exporter.rb
index 0db286434..6f89fb6c1 100644
--- a/app/exporters/chouette/hub/connection_link_exporter.rb
+++ b/app/exporters/chouette/hub/connection_link_exporter.rb
@@ -31,7 +31,7 @@ class Chouette::Hub::ConnectionLinkExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("CORRESPONDANCE\u000D\u000A") if f.size == 0
f.write(render) if (connection_link.present? && connection_link.link_distance.present?)
end
diff --git a/app/exporters/chouette/hub/direction_exporter.rb b/app/exporters/chouette/hub/direction_exporter.rb
index 03c4c8c85..e81efbe32 100644
--- a/app/exporters/chouette/hub/direction_exporter.rb
+++ b/app/exporters/chouette/hub/direction_exporter.rb
@@ -30,7 +30,7 @@ class Chouette::Hub::DirectionExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("DIRECTION\u000D\u000A") if f.size == 0
f.write(render)
end if journey_pattern.present?
diff --git a/app/exporters/chouette/hub/exporter.rb b/app/exporters/chouette/hub/exporter.rb
index 27ac4e7ee..110ad6b61 100644
--- a/app/exporters/chouette/hub/exporter.rb
+++ b/app/exporters/chouette/hub/exporter.rb
@@ -133,6 +133,7 @@ class Chouette::Hub::Exporter
if journey_patterns_exportable?
Chouette::Hub::RouteExporter.save(@routes, temp_dir, hub_export)
+ Chouette::Hub::ItlExporter.save(@routes, temp_dir, hub_export)
Chouette::Hub::JourneyPatternExporter.save(@journey_patterns, temp_dir, hub_export)
Chouette::Hub::DirectionExporter.save(@journey_patterns, temp_dir, hub_export)
else
diff --git a/app/exporters/chouette/hub/group_of_lines_exporter.rb b/app/exporters/chouette/hub/group_of_lines_exporter.rb
index 2b07d7c4d..7b69eb6e3 100644
--- a/app/exporters/chouette/hub/group_of_lines_exporter.rb
+++ b/app/exporters/chouette/hub/group_of_lines_exporter.rb
@@ -26,7 +26,7 @@ class Chouette::Hub::GroupOfLinesExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("GROUPELIGNE\u000D\u000A") if f.size == 0
f.write(render)
end if group_of_lines.present?
diff --git a/app/exporters/chouette/hub/itl_exporter.rb b/app/exporters/chouette/hub/itl_exporter.rb
new file mode 100644
index 000000000..8c281d965
--- /dev/null
+++ b/app/exporters/chouette/hub/itl_exporter.rb
@@ -0,0 +1,65 @@
+class Chouette::Hub::ItlExporter
+ include ERB::Util
+ attr_accessor :stop_point, :stop_area_id, :stop_area_code, :line_code, :sens, :order, :type, :identifier, :directory, :template
+
+ def initialize(stop_point, sens, line, directory, index)
+ @stop_point = stop_point
+ @directory = directory
+ @template = File.open('app/views/api/hub/itls.hub.erb' ){ |f| f.read }
+ @line_code = line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if line
+ @sens = sens == 'A' ? 1 : 2
+ stop_area = stop_point.stop_area
+ if stop_area
+ @stop_area_code = stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2')
+ @stop_area_id = stop_area.registration_number
+ end
+ @order = stop_point.position
+ if stop_point.for_boarding == "forbidden"
+ @type = 1
+ elsif stop_point.for_alighting == "forbidden"
+ @type = 2
+ end
+ @identifier = index
+ end
+
+ def render()
+ ERB.new(@template).result(binding)
+ end
+
+ def hub_name
+ "/ITL.TXT"
+ end
+
+ def self.save( routes, directory, hub_export)
+ count = 0
+ routes.each do |route|
+ for_boarding_stops = route.stop_points.where( :for_boarding => [ "forbidden" , "normal"] ).order(:position)
+ if for_boarding_stops
+ for_boarding_stops.each do |stop_point|
+ count += 1
+ self.new( stop_point, route.wayback, route.line, directory, count ).tap do |specific_exporter|
+ specific_exporter.save
+ end
+ end
+ end
+ for_alighting_stops = route.stop_points.where( :for_alighting => [ "forbidden" , "normal"] ).order(:position)
+ if for_alighting_stops
+ for_alighting_stops.each do |stop_point|
+ count += 1
+ self.new( stop_point, route.wayback, route.line, directory, count ).tap do |specific_exporter|
+ specific_exporter.save
+ end
+ end
+ end
+ end
+ hub_export.log_messages.create( :severity => "ok", :key => "EXPORT|ITL_COUNT", :arguments => {"0" => count})
+ end
+
+ def save
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
+ f.write("ITL\u000D\u000A") if f.size == 0
+ f.write(render)
+ end if stop_point.present?
+ end
+end
+
diff --git a/app/exporters/chouette/hub/journey_pattern_exporter.rb b/app/exporters/chouette/hub/journey_pattern_exporter.rb
index 97cbab41d..0ec8d76c5 100644
--- a/app/exporters/chouette/hub/journey_pattern_exporter.rb
+++ b/app/exporters/chouette/hub/journey_pattern_exporter.rb
@@ -40,7 +40,7 @@ class Chouette::Hub::JourneyPatternExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("CHEMIN\u000D\u000A") if f.size == 0
f.write(render)
end if journey_pattern.present?
diff --git a/app/exporters/chouette/hub/line_exporter.rb b/app/exporters/chouette/hub/line_exporter.rb
index 622f7a924..464cad077 100644
--- a/app/exporters/chouette/hub/line_exporter.rb
+++ b/app/exporters/chouette/hub/line_exporter.rb
@@ -31,7 +31,7 @@ class Chouette::Hub::LineExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("LIGNE\u000D\u000A") if f.size == 0
f.write(render)
end if line.present?
diff --git a/app/exporters/chouette/hub/network_exporter.rb b/app/exporters/chouette/hub/network_exporter.rb
index fc77a84fc..a333beda2 100644
--- a/app/exporters/chouette/hub/network_exporter.rb
+++ b/app/exporters/chouette/hub/network_exporter.rb
@@ -26,7 +26,7 @@ class Chouette::Hub::NetworkExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("RESEAU\u000D\u000A") if f.size == 0
f.write(render)
end if network.present?
diff --git a/app/exporters/chouette/hub/physical_stop_area_exporter.rb b/app/exporters/chouette/hub/physical_stop_area_exporter.rb
index a8d992735..a0bf054a6 100644
--- a/app/exporters/chouette/hub/physical_stop_area_exporter.rb
+++ b/app/exporters/chouette/hub/physical_stop_area_exporter.rb
@@ -7,6 +7,9 @@ class Chouette::Hub::PhysicalStopAreaExporter
@directory = directory
@template = File.open('app/views/api/hub/arrets_physiques.hub.erb' ){ |f| f.read }
@type = "NNNNNNNNNNNNNNNNNN"
+ if @stop_area.mobility_restricted_suitability
+ @type = "NNNNNNNNNNNNNONNNN"
+ end
if @stop_area.parent_id
@parent = Chouette::StopArea.find(@stop_area.parent_id)
end
@@ -38,7 +41,7 @@ class Chouette::Hub::PhysicalStopAreaExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("ARRET\u000D\u000A") if f.size == 0
f.write(render)
end if stop_area.present?
diff --git a/app/exporters/chouette/hub/route_exporter.rb b/app/exporters/chouette/hub/route_exporter.rb
index e94780329..670f977aa 100644
--- a/app/exporters/chouette/hub/route_exporter.rb
+++ b/app/exporters/chouette/hub/route_exporter.rb
@@ -35,7 +35,7 @@ class Chouette::Hub::RouteExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("SCHEMA\u000D\u000A") if f.size == 0
f.write(render)
end if route.present?
diff --git a/app/exporters/chouette/hub/time_table_exporter.rb b/app/exporters/chouette/hub/time_table_exporter.rb
index 2553128cd..98fac8fef 100644
--- a/app/exporters/chouette/hub/time_table_exporter.rb
+++ b/app/exporters/chouette/hub/time_table_exporter.rb
@@ -1,15 +1,19 @@
class Chouette::Hub::TimeTableExporter
include ERB::Util
- attr_accessor :time_table, :directory, :template, :start_date, :end_date, :identifier
+ attr_accessor :directory, :template, :time_table, :code, :comment, :start_date, :end_date, :calendar, :identifier
- def initialize(time_table, directory, identifier)
+ def initialize(time_table, directory, index)
@time_table = time_table
@directory = directory
- @identifier = identifier
@template = File.open('app/views/api/hub/periodes.hub.erb' ){ |f| f.read }
+
+ @code = time_table.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2')
+ @comment = time_table.comment.encode(Encoding::Windows_1252) if time_table.comment
+ @start_date = time_table.start_date.strftime("%d/%m/%Y")
+ @end_date = time_table.end_date.strftime("%d/%m/%Y")
@calendar = ""
- s_date = @time_table.start_date
- e_date = @time_table.end_date
+ s_date = time_table.start_date
+ e_date = time_table.end_date
while s_date <= e_date
if time_table.include_day?(s_date)
@calendar += "1"
@@ -18,6 +22,7 @@ class Chouette::Hub::TimeTableExporter
end
s_date = s_date.next_day
end
+ @identifier = index
end
def render()
@@ -29,18 +34,18 @@ class Chouette::Hub::TimeTableExporter
end
def self.save(time_tables, directory, hub_export)
- identifier = 1
+ index = 1
time_tables.each do |time_table|
- self.new(time_table, directory, identifier).tap do |specific_exporter|
+ self.new(time_table, directory, index).tap do |specific_exporter|
specific_exporter.save
- identifier += 1
+ index += 1
end
end
hub_export.log_messages.create( :severity => "ok", :key => "EXPORT|TIME_TABLE_COUNT", :arguments => {"0" => time_tables.size})
end
-
+
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("PERIODE\u000D\u000A") if f.size == 0
f.write(render)
end if time_table.present?
diff --git a/app/exporters/chouette/hub/transport_mode_exporter.rb b/app/exporters/chouette/hub/transport_mode_exporter.rb
index 46d116eec..7b959d3be 100644
--- a/app/exporters/chouette/hub/transport_mode_exporter.rb
+++ b/app/exporters/chouette/hub/transport_mode_exporter.rb
@@ -27,7 +27,7 @@ class Chouette::Hub::TransportModeExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("MODETRANSPORT\u000D\u000A") if f.size == 0
f.write(render)
end
diff --git a/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb b/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb
index 1c4b4c620..504ff18a3 100644
--- a/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb
+++ b/app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb
@@ -6,7 +6,7 @@ class Chouette::Hub::VehicleJourneyAtStopExporter
@vehicle_journey_at_stop = vehicle_journey_at_stop
@directory = directory
@vehicle_journey_num = index
- @vehicle_journey_id = id
+ @id = id
@template = File.open('app/views/api/hub/horaires.hub.erb' ) { |f| f.read }
stop_point = @vehicle_journey_at_stop.stop_point
stop_area = stop_point.stop_area
@@ -49,7 +49,7 @@ class Chouette::Hub::VehicleJourneyAtStopExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("HORAIRE\u000D\u000A") if f.size == 0
f.write(render)
end if vehicle_journey_at_stop.present?
diff --git a/app/exporters/chouette/hub/vehicle_journey_exporter.rb b/app/exporters/chouette/hub/vehicle_journey_exporter.rb
index fb854566b..5ddb536c8 100644
--- a/app/exporters/chouette/hub/vehicle_journey_exporter.rb
+++ b/app/exporters/chouette/hub/vehicle_journey_exporter.rb
@@ -25,7 +25,7 @@ class Chouette::Hub::VehicleJourneyExporter
@arrival_time_sec = arrival_time.sec + ( arrival_time.min + arrival_time.hour * 60 ) * 60
@validity = 0
#@vehicle_journey.time_tables.map(&:int_day_types).each { |v| @validity |= v }
- @vehicle_journey.time_tables.each { |t| @validity |= t.int_day_types if t.int_day_types }
+ @vehicle_journey.time_tables.each { |t| @validity |= ((t.int_day_types / 4) & 127 ) if t.int_day_types }
periods = Chouette::TimeTable.where( :id => @vehicle_journey.time_tables.map(&:id) ).map(&:objectid)
@periods = ""
@@ -38,13 +38,13 @@ class Chouette::Hub::VehicleJourneyExporter
end
# USE @renvoi for PMR and TAD and create RENVOI.TXT File
@renvoi = ""
- if @vehicle_journey.mobility_restricted_suitability
+ if @vehicle_journey.mobility_restricted_suitability || @line.mobility_restricted_suitability
@renvoi = "1"
- end
- File.open(directory + "/RENVOI.TXT" , "a:ISO_8859_1") do |f|
- if f.size == 0
- f.write("RENVOI\u000D\u000A")
- f.write("a;PMR;1\u000D\u000A")
+ File.open(directory + "/RENVOI.TXT" , "a:Windows_1252") do |f|
+ if f.size == 0
+ f.write("RENVOI\u000D\u000A")
+ f.write("a;PMR;1\u000D\u000A")
+ end
end
end
end
@@ -67,7 +67,7 @@ class Chouette::Hub::VehicleJourneyExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("COURSE\u000D\u000A") if f.size == 0
f.write(render)
end if vehicle_journey.present?
diff --git a/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb b/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb
index 533f0628e..b6dd6bc78 100644
--- a/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb
+++ b/app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb
@@ -91,7 +91,7 @@ class Chouette::Hub::VehicleJourneyOperationExporter
end
def save
- File.open(directory + hub_name , "a:ISO_8859_1") do |f|
+ File.open(directory + hub_name , "a:Windows_1252") do |f|
f.write("COURSE_OPERATION\u000D\u000A") if f.size == 0
f.write(render)
end if vehicle_journey.present?
diff --git a/app/models/compliance_check_task.rb b/app/models/compliance_check_task.rb
index 80fbad38f..1808a792c 100644
--- a/app/models/compliance_check_task.rb
+++ b/app/models/compliance_check_task.rb
@@ -1,4 +1,5 @@
class ComplianceCheckTask < ActiveRecord::Base
+
attr_accessor :rule_parameter_set_id
belongs_to :referential
@@ -9,7 +10,7 @@ class ComplianceCheckTask < ActiveRecord::Base
validates_presence_of :user_name
validates_inclusion_of :status, :in => %w{ pending processing completed failed }
- has_many :compliance_check_results, :order => :status
+ has_many :compliance_check_results, :order => [ :severity , :status ]
serialize :parameter_set, JSON
@@ -100,6 +101,4 @@ class ComplianceCheckTask < ActiveRecord::Base
update_attribute :status, "failed"
end
end
-
-
end
diff --git a/app/models/compliance_check_task_export.rb b/app/models/compliance_check_task_export.rb
new file mode 100644
index 000000000..e845aa235
--- /dev/null
+++ b/app/models/compliance_check_task_export.rb
@@ -0,0 +1,52 @@
+require 'tempfile'
+
+class ComplianceCheckTaskExport
+ include ERB::Util
+
+ require 'zip'
+
+ attr_accessor :template, :detailed_errors_template, :request
+ attr_reader :compliance_check_task
+
+ def initialize(compliance_check_task, request)
+ @request = request
+ @compliance_check_task = compliance_check_task
+ @template = File.open('app/views/compliance_check_tasks/summary_errors_index.csv.erb' ) { |f| f.read }
+ @detailed_errors_template = File.open('app/views/compliance_check_tasks/detailed_errors_index.csv.erb' ) { |f| f.read }
+ end
+
+ def export
+ begin
+ Dir.mktmpdir("compliance_check_results_#{@compliance_check_task.referential_id}_#{@compliance_check_task.id}_", Dir.tmpdir) { |temp_dir|
+
+ File.open(temp_dir + "/summary_errors_index.csv" , "a") do |f|
+ f.write(render)
+ f.flush
+ end
+
+ File.open(temp_dir + "/detailed_errors_report.csv" , "a") do |f|
+ f.write(detailed_errors_render)
+ f.flush
+ end
+
+ zip_file = Tempfile.new(["compliance_check_results_#{@compliance_check_task.referential_id}_#{@compliance_check_task.id}_", ".zip"])
+
+ ::Zip::File.open(zip_file.path, ::Zip::File::CREATE) do |zipfile|
+ Dir[File.join(temp_dir, '*.csv')].each do |f|
+ zipfile.add(File.basename(f), f)
+ end
+ end
+ return zip_file
+ }
+ end
+ end
+
+ def render()
+ ERB.new(@template).result(binding)
+ end
+
+ def detailed_errors_render()
+ ERB.new(@detailed_errors_template).result(binding)
+ end
+
+end
diff --git a/app/views/api/hub/arrets_generiques.hub.erb b/app/views/api/hub/arrets_generiques.hub.erb
index 00f041552..ba28d3fff 100644
--- a/app/views/api/hub/arrets_generiques.hub.erb
+++ b/app/views/api/hub/arrets_generiques.hub.erb
@@ -1 +1 @@
-<%= @stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @stop_area.objectid %>;<%= @stop_area.name.encode(Encoding::ISO_8859_1) if @stop_area.name %>;<%= @stop_area.nearest_topic_name.encode(Encoding::ISO_8859_1) if @stop_area.nearest_topic_name %>;<%= @type %>;;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[0].to_i : '' %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[1].to_i : '' %>;<%= @stop_area.city_name.encode(Encoding::ISO_8859_1) if @stop_area.city_name %>;<%= @stop_area.zip_code if @stop_area.zip_code %>;<%= @stop_area.comment.encode(Encoding::ISO_8859_1) if @stop_area.comment %>;<%= "\u000D\u000A" %> \ No newline at end of file
+<%= @stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @stop_area.objectid %>;<%= @stop_area.name.encode(Encoding::Windows_1252) if @stop_area.name %>;<%= @stop_area.nearest_topic_name.encode(Encoding::Windows_1252) if @stop_area.nearest_topic_name %>;<%= @type %>;;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[0].to_i : '' %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[1].to_i : '' %>;<%= @stop_area.city_name.encode(Encoding::Windows_1252) if @stop_area.city_name %>;<%= @stop_area.zip_code if @stop_area.zip_code %>;<%= @stop_area.comment.encode(Encoding::Windows_1252) if @stop_area.comment %>;<%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/arrets_physiques.hub.erb b/app/views/api/hub/arrets_physiques.hub.erb
index 02cb11238..626ee6454 100644
--- a/app/views/api/hub/arrets_physiques.hub.erb
+++ b/app/views/api/hub/arrets_physiques.hub.erb
@@ -1 +1 @@
-<%= @stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @stop_area.objectid %>;<%= @stop_area.name.encode(Encoding::ISO_8859_1) if @stop_area.name %>;<%= @stop_area.nearest_topic_name.encode(Encoding::ISO_8859_1) if @stop_area.nearest_topic_name %>;<%= @type %>;<%= @parent.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @parent %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[0].to_i : -1 %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[1].to_i : -1 %>;<%= @stop_area.city_name.encode(Encoding::ISO_8859_1) if @stop_area.city_name %>;<%= @stop_area.zip_code if @stop_area.zip_code %>;<%= @stop_area.comment.encode(Encoding::ISO_8859_1) if @stop_area.comment %>;<%= @stop_area.registration_number %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @stop_area.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @stop_area.objectid %>;<%= @stop_area.name.encode(Encoding::Windows_1252) if @stop_area.name %>;<%= @stop_area.nearest_topic_name.encode(Encoding::Windows_1252) if @stop_area.nearest_topic_name %>;<%= @type %>;<%= @parent.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @parent %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[0].to_i : -1 %>;<%= (@stop_area.latitude && @stop_area.longitude) ? RGeo::CoordSys::Proj4::transform_coords(@from_projection, @to_projection, @stop_area.longitude, @stop_area.latitude)[1].to_i : -1 %>;<%= @stop_area.city_name.encode(Encoding::Windows_1252) if @stop_area.city_name %>;<%= @stop_area.zip_code if @stop_area.zip_code %>;<%= @stop_area.comment.encode(Encoding::Windows_1252) if @stop_area.comment %>;<%= @stop_area.registration_number %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/chemins.hub.erb b/app/views/api/hub/chemins.hub.erb
index f5408c51f..38ea4e562 100644
--- a/app/views/api/hub/chemins.hub.erb
+++ b/app/views/api/hub/chemins.hub.erb
@@ -1 +1 @@
-<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @line %>;<%= @journey_pattern.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @journey_pattern.objectid %>;<%= @journey_pattern.registration_number if @journey_pattern.registration_number %>;<%= @journey_pattern.name.encode(Encoding::ISO_8859_1) if @journey_pattern.name %>;<%= (@journey_pattern.route.wayback == 'A' ? 1 : 2) if @journey_pattern.route %>;<%= @type %>;<% @stop_areas.each do |s| %>;<%= s.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if s.objectid %>;<%= s.registration_number %>;;<% end %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @line %>;<%= @journey_pattern.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @journey_pattern.objectid %>;<%= @journey_pattern.registration_number if @journey_pattern.registration_number %>;<%= @journey_pattern.name.encode(Encoding::Windows_1252) if @journey_pattern.name %>;<%= (@journey_pattern.route.wayback == 'A' ? 1 : 2) if @journey_pattern.route %>;<%= @type %>;<% @stop_areas.each do |s| %>;<%= s.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if s.objectid %>;<%= s.registration_number %>;;<% end %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/communes.hub.erb b/app/views/api/hub/communes.hub.erb
index 265271c54..cb981b0d2 100644
--- a/app/views/api/hub/communes.hub.erb
+++ b/app/views/api/hub/communes.hub.erb
@@ -1 +1 @@
-<%= @city_code %>;<%= @city_name.encode(Encoding::ISO_8859_1) if @city_name %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @city_code %>;<%= @city_name.encode(Encoding::Windows_1252) if @city_name %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/directions.hub.erb b/app/views/api/hub/directions.hub.erb
index dd069968d..031c38d7b 100644
--- a/app/views/api/hub/directions.hub.erb
+++ b/app/views/api/hub/directions.hub.erb
@@ -1 +1 @@
-<%= @journey_pattern.name.encode(Encoding::ISO_8859_1) if @journey_pattern.name %>;<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @line %>;<%= (@journey_pattern.route.wayback == 'A' ? 1 : 2) if @journey_pattern.route %>;<%= @journey_pattern.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @journey_pattern.objectid %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @journey_pattern.name.encode(Encoding::Windows_1252) if @journey_pattern.name %>;<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @line %>;<%= (@journey_pattern.route.wayback == 'A' ? 1 : 2) if @journey_pattern.route %>;<%= @journey_pattern.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @journey_pattern.objectid %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/groupe_de_lignes.hub.erb b/app/views/api/hub/groupe_de_lignes.hub.erb
index 2547c1e11..fe4f6d849 100644
--- a/app/views/api/hub/groupe_de_lignes.hub.erb
+++ b/app/views/api/hub/groupe_de_lignes.hub.erb
@@ -1 +1 @@
-<%= @group_of_lines.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @group_of_lines.name.encode(Encoding::ISO_8859_1) if @group_of_lines.name %>;<%= @group_of_lines.id %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @group_of_lines.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @group_of_lines.name.encode(Encoding::Windows_1252) if @group_of_lines.name %>;<%= @group_of_lines.id %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/horaires.hub.erb b/app/views/api/hub/horaires.hub.erb
index 1497588af..6c5b9d04b 100644
--- a/app/views/api/hub/horaires.hub.erb
+++ b/app/views/api/hub/horaires.hub.erb
@@ -1 +1 @@
-<%= @stop_area_code %>;<%= @arrival_time %>;<%= @arrival_type %>;<%= @vehicle_journey_num %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @stop_area_id %>;<%= 2 * @vehicle_journey_id - 1 %><%= "\u000D\u000A" %><%= @stop_area_code %>;<%= @departure_time %>;<%= @departure_type %>;<%= @vehicle_journey_num %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @stop_area_id %>;<%= 2 * @vehicle_journey_id %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @stop_area_code %>;<%= @arrival_time %>;<%= @arrival_type %>;<%= @vehicle_journey_num %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @stop_area_id %>;<%= 2 * @id - 1 %><%= "\u000D\u000A" %><%= @stop_area_code %>;<%= @departure_time %>;<%= @departure_type %>;<%= @vehicle_journey_num %>;<%= @vehicle_journey_at_stop.vehicle_journey.journey_pattern_id %>;<%= @stop_area_id %>;<%= 2 * @id %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/itls.hub.erb b/app/views/api/hub/itls.hub.erb
new file mode 100644
index 000000000..8bf596185
--- /dev/null
+++ b/app/views/api/hub/itls.hub.erb
@@ -0,0 +1 @@
+<%= @line_code %>;<%= @sens %>;<%= @stop_area_code %>;<%= @stop_area_id %>;<%= @order %>;<%= @type %>;<%= @identifier %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/lignes.hub.erb b/app/views/api/hub/lignes.hub.erb
index 921eb7056..604d52812 100644
--- a/app/views/api/hub/lignes.hub.erb
+++ b/app/views/api/hub/lignes.hub.erb
@@ -1 +1 @@
-<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @line.objectid %>;<%= @line.number %>;<%= @line.name.encode(Encoding::ISO_8859_1) if @line.name %>;;;<%= @company.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @company %>;<%= @network.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @network %>;<%= @group_of_line %>;<%= @line.id %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @line.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @line.objectid %>;<%= @line.number %>;<%= @line.name.encode(Encoding::Windows_1252) if @line.name %>;;;<%= @company.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @company %>;<%= @network.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') if @network %>;<%= @group_of_line %>;<%= @line.id %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/periodes.hub.erb b/app/views/api/hub/periodes.hub.erb
index 2bb3e8368..64737c17d 100644
--- a/app/views/api/hub/periodes.hub.erb
+++ b/app/views/api/hub/periodes.hub.erb
@@ -1 +1 @@
-<%= Chouette::TimeTable.find(@time_table.id).objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @time_table.comment.encode(Encoding::ISO_8859_1) if @time_table.comment %>;<%= @time_table.start_date.strftime("%d/%m/%Y") %>;<%= @time_table.end_date.strftime("%d/%m/%Y") %>;<%= @calendar %>;<%= @identifier %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @code %>;<%= @comment %>;<%= @start_date %>;<%= @end_date %>;<%= @calendar %>;<%= @identifier %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/reseaux.hub.erb b/app/views/api/hub/reseaux.hub.erb
index 95ab8d547..f8894f9cd 100644
--- a/app/views/api/hub/reseaux.hub.erb
+++ b/app/views/api/hub/reseaux.hub.erb
@@ -1 +1 @@
-<%= @network.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @network.name.encode(Encoding::ISO_8859_1) if @network.name %>;<%= @network.id %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @network.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @network.name.encode(Encoding::Windows_1252) if @network.name %>;<%= @network.id %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/api/hub/transporteurs.hub.erb b/app/views/api/hub/transporteurs.hub.erb
index 595d3b5fb..8ee7aa5ce 100644
--- a/app/views/api/hub/transporteurs.hub.erb
+++ b/app/views/api/hub/transporteurs.hub.erb
@@ -1 +1 @@
-<%= @company.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @company.name.encode(Encoding::ISO_8859_1) if @company.name %>;<%= @company.id %><%= "\u000D\u000A" %> \ No newline at end of file
+<%= @company.objectid.sub(/(\w*\:\w*\:)(\w*)/, '\2') %>;<%= @company.name.encode(Encoding::Windows_1252) if @company.name %>;<%= @company.id %><%= "\u000D\u000A" %> \ No newline at end of file
diff --git a/app/views/compliance_check_tasks/detailed_errors_index.csv.erb b/app/views/compliance_check_tasks/detailed_errors_index.csv.erb
new file mode 100644
index 000000000..339210f92
--- /dev/null
+++ b/app/views/compliance_check_tasks/detailed_errors_index.csv.erb
@@ -0,0 +1,2 @@
+<%= ComplianceCheckResult.human_attribute_name(:severity) %>;<%= ComplianceCheckResult.human_attribute_name(:rule_code) %>;<%= ComplianceCheckResult.human_attribute_name(:object) %>;<%= ComplianceCheckResult.human_attribute_name(:resource) %>;<%= ComplianceCheckResult.human_attribute_name(:detail) %>;
+<% @compliance_check_task.compliance_check_results.each do |r| %><% if r.detail.present? %><% r.detail["detail"].first(10).each do |error| %><% case r.severity %><% when "warning" %><%= I18n.t "compliance_check_result.severities.warning" %><% when "error" %><%= I18n.t "compliance_check_result.severities.error" %><% end %>;<%= r.rule_code %>;<% if error["messageArgs"] %><%= error["messageArgs"]["objectId"] %><% end %>;<% if error["location"]["url"].present? %><%= "http://#{request.host}:#{request.port}#{request.fullpath.sub(/(compliance_check_tasks.*)/, '')}" + error["location"]["url"] %><% elsif error["location"]["filename"].present? %><%= error["objectId"] + " - " %><%= File.basename(error["location"]["filename"]) +" - " %><%= I18n.t "compliance_check_results.index.column" %>: <%= error["location"]["columnNumber"] %>, <%= I18n.t "compliance_check_results.index.line" %>: <%= error["location"]["lineNumber"] %><% end %>;<% if error["messageArgs"] %><%= ComplianceCheckResult.human_attribute_name(r.rule_code) + " " + I18n.t("compliance_check_result.details." + error["messageKey"], error["messageArgs"].symbolize_keys ) %><% else %> <<%= ComplianceCheckResult.human_attribute_name(r.rule_code) + " " + I18n.t("compliance_check_result.details." + error["messageKey"] ) %><% end %><%= "\n" %><% end %><% end %><% end %> \ No newline at end of file
diff --git a/app/views/compliance_check_tasks/show.html.erb b/app/views/compliance_check_tasks/show.html.erb
index c72d9350f..2fa39ff6f 100644
--- a/app/views/compliance_check_tasks/show.html.erb
+++ b/app/views/compliance_check_tasks/show.html.erb
@@ -31,6 +31,7 @@
</div>
<% content_for :sidebar do %>
<ul class="actions">
+ <li><%= link_to t('compliance_check_tasks.actions.download'), export_referential_compliance_check_task_path(@referential, @compliance_check_task) %></il>
<li><%= link_to t('compliance_check_tasks.actions.destroy'), referential_compliance_check_task_path(@referential, @compliance_check_task), :method => :delete, :data => {:confirm => t('compliance_check_tasks.actions.destroy_confirm')}, :class => "remove" %></li>
</ul>
diff --git a/app/views/compliance_check_tasks/summary_errors_index.csv.erb b/app/views/compliance_check_tasks/summary_errors_index.csv.erb
new file mode 100644
index 000000000..e51ad28c2
--- /dev/null
+++ b/app/views/compliance_check_tasks/summary_errors_index.csv.erb
@@ -0,0 +1,3 @@
+<%= ComplianceCheckResult.human_attribute_name(:severity) %>;<%= ComplianceCheckResult.human_attribute_name(:status) %>;<%= ComplianceCheckResult.human_attribute_name(:rule_code) %>;<%= ComplianceCheckResult.human_attribute_name(:detail) %>;<%= ComplianceCheckResult.human_attribute_name(:url) %>;<%= ComplianceCheckResult.human_attribute_name(:violation_count) %>;<%= ComplianceCheckResult.human_attribute_name(:objects) %>
+<% @compliance_check_task.compliance_check_results.each do |r| %><% case r.severity %><% when "warning" %><%= I18n.t "compliance_check_result.severities.warning" %><% when "error" %><%= I18n.t "compliance_check_result.severities.error" %><% end %>;<%= r.status %>;<%= r.rule_code %>;<%= ComplianceCheckResult.human_attribute_name(r.rule_code) %>;<%= Rails.application.config.validation_spec + I18n.locale.to_s + "/" + r.rule_code + ".html" %>;<%= r.violation_count %><% if r.violation_count > 0 %><% if r.detail.present? %>;<% r.detail["detail"].first(10).each do |error| %><% if error["messageArgs"] %><%= error["messageArgs"]["objectId"] + " " %><% else %><%= " " %><% end %><% end %><% end %><% end %>
+<% end %> \ No newline at end of file
diff --git a/app/views/connection_links/show.html.erb b/app/views/connection_links/show.html.erb
index 58649d245..0771caac4 100644
--- a/app/views/connection_links/show.html.erb
+++ b/app/views/connection_links/show.html.erb
@@ -22,7 +22,11 @@
</p>
<p>
<label><%= @connection_link.human_attribute_name("connection_link_type") %>: </label>
- <%= t("connection_link_types.label.#{@connection_link.connection_link_type}") %>
+ <% if @connection_link.connection_link_type.blank? %>
+ <%= t("connection_link_types.label.undefined") %>
+ <% else %>
+ <%= t("connection_link_types.label.#{@connection_link.connection_link_type}") %>
+ <% end %>
</p>
<p>
<label><%= @connection_link.human_attribute_name("comment") %>: </label>
diff --git a/app/views/group_of_lines/_form.erb b/app/views/group_of_lines/_form.erb
index a0ef4a4c4..9482248b6 100644
--- a/app/views/group_of_lines/_form.erb
+++ b/app/views/group_of_lines/_form.erb
@@ -1,6 +1,7 @@
<%= semantic_form_for [@referential, @group_of_line] do |form| %>
<%= form.inputs do %>
<%= form.input :name %>
+ <%= form.input :registration_number %>
<%= form.input :comment %>
<%= form.input :objectid, :required => !@group_of_line.new_record?, :input_html => { :title => t("formtastic.titles.group_of_line.objectid")} %>
<% end %>
diff --git a/app/views/group_of_lines/show.html.erb b/app/views/group_of_lines/show.html.erb
index 07527f209..3369f284d 100644
--- a/app/views/group_of_lines/show.html.erb
+++ b/app/views/group_of_lines/show.html.erb
@@ -4,6 +4,10 @@
<%= @map.to_html %>
<div class="summary">
<p>
+ <label><%= @group_of_line.human_attribute_name("registration_number") %>: </label>
+ <%= @group_of_line.registration_number %>
+ </p>
+ <p>
<label><%= @group_of_line.human_attribute_name("comment") %>: </label>
<%= @group_of_line.comment %>
</p>
diff --git a/config/deploy/private.rb b/config/deploy/private.rb
new file mode 100644
index 000000000..58301b4fe
--- /dev/null
+++ b/config/deploy/private.rb
@@ -0,0 +1,3 @@
+server "chouette-private.marseille.cityway.fr", :app, :web, :db, :primary => true
+set :branch, "V2_5"
+set :gui_cmd, "2.5.1"
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
index 57d36de2d..3baa258d0 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/production.rb
@@ -1,3 +1,3 @@
-server "chouette.cityway.fr", :app, :web, :db, :primary => true
+server "chouette.marseille.cityway.fr", :app, :web, :db, :primary => true
set :branch, "V2_5"
set :gui_cmd, "2.5.1" \ No newline at end of file
diff --git a/config/deploy/sismo.rb b/config/deploy/sismo.rb
deleted file mode 100644
index 4e7c6cd57..000000000
--- a/config/deploy/sismo.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-server "chouette-sismo.marseille.cityway.fr", :app, :web, :db, :primary => true
-set :branch, "V2_5"
-set :gui_cmd, "2.5.1"
diff --git a/config/locales/compliance_check_results.yml b/config/locales/compliance_check_results.yml
index 96ac952fe..48333ef12 100644
--- a/config/locales/compliance_check_results.yml
+++ b/config/locales/compliance_check_results.yml
@@ -260,9 +260,13 @@ en:
rule_target: "Object"
rule_number: "Step"
rule_code: "Code"
- violation_count: "Violation(s)"
+ violation_count: "Number of violations"
+ objects: "Objects in violations"
detail: "Detail"
-
+ object: "Error object"
+ resource: "Resources of the error object"
+ url: "URL"
+ first_violations: "First violations"
fr:
compliance_check_results:
index:
@@ -402,7 +406,6 @@ fr:
detail_3_vehiclejourney_6: "La course %{objectId} a un mode de transport interdit %{transportMode}"
detail_3_facility_1: "L'équipement %{name} (%{objectId}) n'est pas géolocalisé"
detail_3_facility_2: "L'équipement %{name} (%{objectId}) est localisé trop loin de son parent %{areaName} (%{areaId}) : distance %{distance} > %{distanceLimit}"
-
activerecord:
models:
compliance_check_result:
@@ -524,6 +527,11 @@ fr:
rule_target: "Objet"
rule_number: "Etape"
rule_code: "Code"
- violation_count: "Violation(s)"
+ violation_count: "Nombre de violations"
+ objects: "Objets en violations"
detail: "Détail"
+ object: "Objet en erreur"
+ resource: "Ressource de l'objet en erreur"
+ url: "URL"
+ first_violations: "Premières violations"
diff --git a/config/locales/compliance_check_tasks.yml b/config/locales/compliance_check_tasks.yml
index 00376c2bf..9dcebc024 100644
--- a/config/locales/compliance_check_tasks.yml
+++ b/config/locales/compliance_check_tasks.yml
@@ -23,6 +23,7 @@ en:
destroy: "Destroy this validation"
edit: "Edit this validation"
rule_parameter_set: "Rule parameter set"
+ download: "Download"
statuses:
pending: "Pending"
processing: "Processing"
@@ -89,6 +90,7 @@ fr:
destroy: "Supprimer cette validation"
edit: "Editer cette validation"
rule_parameter_set: "Jeu de paramètres"
+ download: "Télécharger"
statuses:
pending: "En attente ..."
processing: "En cours ..."
diff --git a/config/locales/connection_link_types.yml b/config/locales/connection_link_types.yml
index 0f4f9d408..4a7149a4f 100644
--- a/config/locales/connection_link_types.yml
+++ b/config/locales/connection_link_types.yml
@@ -1,6 +1,7 @@
en:
connection_link_types:
label:
+ undefined: "Undefined"
underground: "Underground"
mixed: "Mixed"
overground: "Overground"
@@ -8,6 +9,7 @@ en:
fr:
connection_link_types:
label:
+ undefined: "Non précisé"
underground: "Souterrain"
mixed: "Mixte"
overground: "Aérien"
diff --git a/config/locales/exports.yml b/config/locales/exports.yml
index 1e01507ce..5cf816d3d 100644
--- a/config/locales/exports.yml
+++ b/config/locales/exports.yml
@@ -36,6 +36,7 @@ en:
COMMUNE_COUNT: "City count : %{0}"
TRANSPORT_MODE_COUNT: "Transport Mode count : %{0}"
ROUTE_COUNT: "Route count : %{0}"
+ ITL_COUNT: "Boardings alightings constraints count : %{0}"
JOURNEY_PATTERN_COUNT: "Journey pattern count : %{0}"
QUAY_AND_BOARDING_POSITION_COUNT: "Quays and Boarding positions count : %{0}"
COMMERCIAL_COUNT: "Commercial stop points count : %{0}"
@@ -165,6 +166,7 @@ fr:
COMMUNE_COUNT: "Nombre de communes : %{0}"
TRANSPORT_MODE_COUNT: "Nombre de modes de transport : %{0}"
ROUTE_COUNT: "Nombre de séquences d'arrêts exportées : %{0}"
+ ITL_COUNT: "Nombre de contraintes de montées / descentes : %{0}"
QUAY_AND_BOARDING_POSITION_COUNT: "Nombre d'arrêts physiques exportés : %{0}"
COMMERCIAL_COUNT: "Nombre d'arrêts commerciaux exportés : %{0}"
STOP_PLACE_COUNT: "Nombres de pôles d'échange exportés : %{0}"
diff --git a/config/locales/group_of_lines.yml b/config/locales/group_of_lines.yml
index 1f970d4f9..a573b2247 100644
--- a/config/locales/group_of_lines.yml
+++ b/config/locales/group_of_lines.yml
@@ -26,6 +26,7 @@ en:
attributes:
group_of_line:
name: "Name"
+ registration_number: "Registration number"
comment: "Comments"
line_count: "Number of lines"
objectid: "Neptune identifier"
@@ -65,6 +66,7 @@ fr:
attributes:
group_of_line:
name: "Nom"
+ registration_number: "Numéro d'enregistrement"
comment: "Commentaire"
line_count: "Nombre de lignes"
objectid: "Identifiant Neptune"
diff --git a/config/routes.rb b/config/routes.rb
index 37cff975e..67eb757ae 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -72,14 +72,16 @@ ChouetteIhm::Application.routes.draw do
collection do
get :name_filter
end
- end
-
- resources :lines, :networks, :group_of_lines do
resources :routes do
member do
get 'edit_boarding_alighting'
put 'save_boarding_alighting'
end
+ end
+ end
+
+ resources :lines, :networks, :group_of_lines do
+ resources :routes do
resources :journey_patterns do
member do
get 'new_vehicle_journey'
@@ -108,6 +110,9 @@ ChouetteIhm::Application.routes.draw do
end
resources :compliance_check_tasks do
member do
+ get 'export', defaults: { format: 'zip' }
+ end
+ member do
get 'rule_parameter_set'
end
collection do
diff --git a/db/migrate/20141216085004_add_registration_number_to_group_of_lines.ninoxe_engine.rb b/db/migrate/20141216085004_add_registration_number_to_group_of_lines.ninoxe_engine.rb
new file mode 100644
index 000000000..b2d05c6d6
--- /dev/null
+++ b/db/migrate/20141216085004_add_registration_number_to_group_of_lines.ninoxe_engine.rb
@@ -0,0 +1,6 @@
+# This migration comes from ninoxe_engine (originally 20141216084607)
+class AddRegistrationNumberToGroupOfLines < ActiveRecord::Migration
+ def change
+ add_column :group_of_lines, :registration_number, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index ba4a8fd52..ab6b71378 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20141210134214) do
+ActiveRecord::Schema.define(:version => 20141216085004) do
create_table "access_links", :force => true do |t|
t.integer "access_point_id", :limit => 8
@@ -218,12 +218,13 @@ ActiveRecord::Schema.define(:version => 20141210134214) do
end
create_table "group_of_lines", :force => true do |t|
- t.string "objectid", :null => false
+ t.string "objectid", :null => false
t.integer "object_version"
t.datetime "creation_time"
t.string "creator_id"
t.string "name"
t.string "comment"
+ t.string "registration_number"
end
add_index "group_of_lines", ["objectid"], :name => "group_of_lines_objectid_key", :unique => true