2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-06-02 12:45:47 +02:00
|
|
|
module Users
|
|
|
|
class StatistiquesController < ApplicationController
|
2024-09-17 15:59:24 +02:00
|
|
|
def nav_bar_profile = nav_bar_user_or_guest
|
|
|
|
|
2021-06-02 12:45:47 +02:00
|
|
|
def statistiques
|
|
|
|
@procedure = procedure
|
|
|
|
return procedure_not_found if @procedure.blank? || @procedure.brouillon?
|
|
|
|
|
|
|
|
@usual_traitement_time = @procedure.stats_usual_traitement_time
|
2021-06-04 16:19:19 +02:00
|
|
|
@usual_traitement_time_by_month = @procedure.stats_usual_traitement_time_by_month_in_days
|
2021-06-02 12:45:47 +02:00
|
|
|
@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
|
2021-07-06 15:43:29 +02:00
|
|
|
Procedure.publiees_ou_closes.find_by(path: params[:path])
|
2021-06-02 12:45:47 +02:00
|
|
|
end
|
2021-06-08 17:55:38 +02:00
|
|
|
|
|
|
|
def procedure_not_found
|
2021-07-06 15:43:29 +02:00
|
|
|
flash.alert = t('errors.messages.procedure_not_found')
|
2021-06-08 17:55:38 +02:00
|
|
|
redirect_to root_path
|
|
|
|
end
|
2021-06-02 12:45:47 +02:00
|
|
|
end
|
|
|
|
end
|