2017-01-10 17:29:38 +01:00
|
|
|
class Admin::ChangeDossierStateController < AdminController
|
|
|
|
def index
|
|
|
|
@dossier = Dossier.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def change
|
|
|
|
@dossier = Dossier.find(params[:dossier][:id])
|
|
|
|
@dossier.update state: params[:next_state]
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
@dossier = Dossier.find(params[:dossier][:id])
|
2017-01-10 17:34:55 +01:00
|
|
|
|
2018-01-11 19:04:39 +01:00
|
|
|
if @dossier.procedure.administrateur.email != current_administrateur.email
|
2017-01-10 17:34:55 +01:00
|
|
|
flash.alert = 'Dossier introuvable'
|
|
|
|
return redirect_to admin_change_dossier_state_path
|
|
|
|
end
|
2017-01-10 17:29:38 +01:00
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|