app/controllers/admin/enrollments_controller.rb
# Show a report summarizing what's closed and what's not
Show a report summarizing what's closed and what's not
Show a report summarizing what ' s closed and what ' s not
def show
    @term = Term.find(params[:id]) if params[:id]
    redirect_to admin_enrollments_index_path and return unless @term
    @open = @term.contracts_active.find(:all, :include => :facilitator, :order => 'users.last_name, users.first_name, contracts.name')
    if(@open.length>0)
      @open_enrollments = Enrollment.find(:all, :conditions => "contract_id in (#{@open.collect{|c| c.id}.join(',')}) and enrollment_status < #{Enrollment::STATUS_CLOSED}", :include => [:participant, {:contract => :facilitator}], :order => 'users.last_name, users.first_name')
      @enrollment_count = @open_enrollments.length
      @open_enrollments = @open_enrollments.group_by{|e| e.contract}
    end
    @closed = @term.contracts_closed(:all, :include => :facilitator, :order => 'facilitator.last_name, facilitator.first_name, contracts.name')
  end
def show @term = Term . find ( params [ :id ] ) if params [ :id ] redirect_to admin_enrollments_index_path and return unless @term @open = @term . contracts_active . find ( :all , :include => :facilitator , :order => 'users.last_name, users.first_name, contracts.name' ) if ( @open . length > 0 ) @open_enrollments = Enrollment . find ( :all , :conditions => "contract_id in (#{@open.collect{|c| c.id}.join(',')}) and enrollment_status < #{Enrollment::STATUS_CLOSED}" , :include => [ :participant , { :contract => :facilitator } ] , :order => 'users.last_name, users.first_name' ) @enrollment_count = @open_enrollments . length @open_enrollments = @open_enrollments . group_by { | e | e . contract } end @closed = @term . contracts_closed ( :all , :include => :facilitator , :order => 'facilitator.last_name, facilitator.first_name, contracts.name' ) end
Show a report summarizing what's closed and what's not
Show a report summarizing what ' s closed and what ' s not