Class ReportsController
In: app/controllers/reports_controller.rb
Parent: ApplicationController
File:reports_controller.rb
(C):Hipposoft 2008, 2009
Purpose:Generate reports describing timesheet entries in various different ways.

          09-Feb-2008 (ADH): Created.

Methods

create   new  

Included Modules

TrackRecordReport TrackRecordSections

Public Instance methods

Generate a report based on a ‘new report’ form submission.

[Source]

    # File app/controllers/reports_controller.rb, line 43
43:   def create
44:     read_options()
45: 
46:     appctrl_patch_params_from_js( :report, :active_task_ids   )
47:     appctrl_patch_params_from_js( :report, :inactive_task_ids )
48: 
49:     @report = Report.new( @current_user, params[ :report ] )
50:     @report.compile()
51: 
52:     respond_to do | format |
53:       format.html { render( { :template => 'reports/show' } ) }
54:       format.csv  { csv_stream_report() }
55:     end
56:   end

Prepare for the ‘new report’ view.

[Source]

    # File app/controllers/reports_controller.rb, line 31
31:   def new
32:     read_options()
33: 
34:     # [TODO] Make a dummy report object. In future, perhaps reports could
35:     # be saved into the database, owned by users.
36: 
37:     @report     = Report.new( @current_user, params[ :report ] )
38:     @user_array = @current_user.restricted? ? [ @current_user ] : User.active
39:   end

[Validate]