af610a4a04
- Ajout des boutons de changement d'état gestionnaire
30 lines
895 B
Ruby
30 lines
895 B
Ruby
class Backoffice::DossiersController < ApplicationController
|
|
before_action :authenticate_gestionnaire!
|
|
|
|
def show
|
|
@dossier = Dossier.find(params[:id])
|
|
@entreprise = @dossier.entreprise.decorate
|
|
@etablissement = @dossier.etablissement
|
|
@pieces_justificatives = @dossier.pieces_justificatives
|
|
@commentaires = @dossier.commentaires.order(created_at: :desc)
|
|
@commentaires = @commentaires.all.decorate
|
|
@commentaire_email = current_gestionnaire.email
|
|
|
|
@procedure = @dossier.procedure
|
|
|
|
@dossier = @dossier.decorate
|
|
rescue ActiveRecord::RecordNotFound
|
|
flash.alert = t('errors.messages.dossier_not_found')
|
|
redirect_to url_for(controller: '/backoffice')
|
|
end
|
|
|
|
def confirme
|
|
params[:id] = params[:dossier_id]
|
|
show
|
|
|
|
@dossier.next_step! 'gestionnaire', 'confirme'
|
|
flash.notice = 'Dossier confirmé avec succès.'
|
|
|
|
render 'show'
|
|
end
|
|
end
|