diff --git a/app/controllers/manager/procedures_controller.rb b/app/controllers/manager/procedures_controller.rb index a6c45dbd9..33843a6c1 100644 --- a/app/controllers/manager/procedures_controller.rb +++ b/app/controllers/manager/procedures_controller.rb @@ -39,6 +39,13 @@ module Manager redirect_to manager_procedure_path(procedure) end + def export_mail_brouillons + dossiers = procedure.dossiers.state_brouillon + emails = dossiers.map { |d| d.user.email }.sort + date = Time.zone.now.strftime('%d-%m-%Y') + send_data(emails.join("\n"), :filename => "brouillons-#{procedure.id}-au-#{date}.csv") + end + def add_administrateur administrateur = Administrateur.by_email(params[:email]) if administrateur diff --git a/app/views/manager/procedures/show.html.erb b/app/views/manager/procedures/show.html.erb index faa058874..cae25c6be 100644 --- a/app/views/manager/procedures/show.html.erb +++ b/app/views/manager/procedures/show.html.erb @@ -71,5 +71,8 @@ as well as a link to its edit page. <% end %> <% end %> +