2017-12-28 19:44:11 +01:00
|
|
|
module Manager
|
|
|
|
class ProceduresController < Manager::ApplicationController
|
2018-01-10 16:46:12 +01:00
|
|
|
def whitelist
|
2018-01-10 17:42:21 +01:00
|
|
|
procedure = Procedure.find(params[:id])
|
2018-01-10 16:46:12 +01:00
|
|
|
procedure.whitelist!
|
2018-09-05 14:48:42 +02:00
|
|
|
flash[:notice] = "Démarche whitelistée."
|
2018-01-10 16:46:12 +01:00
|
|
|
redirect_to manager_procedure_path(procedure)
|
|
|
|
end
|
2018-10-09 12:11:13 +02:00
|
|
|
|
|
|
|
def draft
|
|
|
|
procedure = Procedure.find(params[:id])
|
|
|
|
if procedure.dossiers.empty?
|
|
|
|
procedure.draft!
|
|
|
|
flash[:notice] = "La démarche a bien été passée en brouillon."
|
|
|
|
else
|
|
|
|
flash[:alert] = "Impossible de repasser en brouillon une démarche à laquelle sont rattachés des dossiers."
|
|
|
|
end
|
|
|
|
redirect_to manager_procedure_path(procedure)
|
|
|
|
end
|
2017-12-28 19:44:11 +01:00
|
|
|
end
|
|
|
|
end
|