diff --git a/app/controllers/instructeurs/procedures_controller.rb b/app/controllers/instructeurs/procedures_controller.rb index a76c690a5..b96c83dc5 100644 --- a/app/controllers/instructeurs/procedures_controller.rb +++ b/app/controllers/instructeurs/procedures_controller.rb @@ -209,6 +209,7 @@ module Instructeurs @usual_traitement_time = @procedure.stats_usual_traitement_time @dossiers_funnel = @procedure.stats_dossiers_funnel @termines_states = @procedure.stats_termines_states + @termines_by_week = @procedure.stats_termines_by_week end private diff --git a/app/controllers/users/statistiques_controller.rb b/app/controllers/users/statistiques_controller.rb new file mode 100644 index 000000000..456a93572 --- /dev/null +++ b/app/controllers/users/statistiques_controller.rb @@ -0,0 +1,21 @@ +module Users + class StatistiquesController < ApplicationController + def statistiques + @procedure = procedure + return procedure_not_found if @procedure.blank? || @procedure.brouillon? + + @usual_traitement_time = @procedure.stats_usual_traitement_time + @dossiers_funnel = @procedure.stats_dossiers_funnel + @termines_states = @procedure.stats_termines_states + @termines_by_week = @procedure.stats_termines_by_week + + render :show + end + + private + + def procedure + Procedure.publiees.or(Procedure.brouillons).find_by(path: params[:path]) + end + end +end