Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
removing stuff from dossier controller
Browse files Browse the repository at this point in the history
  • Loading branch information
adamico committed May 14, 2013
1 parent 408d3b2 commit a502dc8
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions app/controllers/dossiers_controller.rb
@@ -1,29 +1,11 @@
#encoding: utf-8
class DossiersController < ApplicationController
before_filter :redirect_unless_connected
before_filter :find_dossier_for_edit
helper_method :evenements
helper_method :medicaments
helper_method :indications
helper_method :enquete

def index
respond_to do |format|
format.json { render json: DossiersDatatable.new(view_context) }
format.xlsx do
@dossiers = DossiersDatatable.new(view_context).as_records
response.headers['Content-Disposition'] = "attachment; filename='#{Date.current}_dossiers.xlsx'"
end
format.pdf do
@dossiers = DossiersDatatable.new(view_context).as_records
pdf = DossierListPdf.new(@dossiers, crpv_name, view_context)
send_data pdf.render, filename: "dossiers_#{crpv_name}.pdf",
type: "application/pdf",
disposition: "inline"
end
end
end

def show
@dossier = Dossier.find(params[:id])
respond_to do |format|
Expand Down Expand Up @@ -109,17 +91,6 @@ def user_crpv_owns_dossier?
end
end

def find_dossier_for_edit
if params[:code_bnpv]
@search = Dossier.where(code_bnpv: params[:code_bnpv]).first rescue nil
if @search
redirect_to edit_dossier_path(@search)
else
redirect_to enquetes_path, notice: "Aucun dossier avec le N° BNPV: #{params[:code_bnpv]}"
end
end
end

def redirect_on_success(flash_message)
if params[:_continue]
redirect_to edit_dossier_path(@dossier), notice: flash_message
Expand Down

0 comments on commit a502dc8

Please sign in to comment.