app/controllers/meeting_reservations_controller.rb
# Collects the reservation data for the specified Meeting ID and outputs a
# custom CSV text file, used as exchange data format in between C.S.I. regional organizations.
#
# This is a Team-manager restricted action.
#
Collects the reservation data for the specified Meeting ID and outputs a
custom CSV text file, used as exchange data format in between C.S.I. regional organizations.

This is a Team-manager restricted action.
Collects the reservation data for the specified Meeting ID and outputs a custom CSV text file used as exchange data format in between C . S . I . regional organizations . This is a Team - manager restricted action .
def export_csi_csv
    unless TeamManagerValidator.can_manage?( current_user, @meeting )
      flash[:error] = I18n.t('meeting.errors.invalid_team_manager_or_no_swimmer')
      redirect_to( meetings_current_path() ) and return
    end
    unless ReservationsCsi2Csv.is_a_csi_meeting( @meeting )
      flash[:error] = I18n.t('meeting_reservation.export_csi_csv_invalid_meeting_error')
      redirect_to( meetings_current_path() ) and return
    end
    csi_2_csv = ReservationsCsi2Csv.new( @meeting, @team )
    csi_2_csv.collect()
    if csi_2_csv.csi_data_rows.size < 1
      flash[:warning] = I18n.t('meeting_reservation.export_csi_csv_no_reservations_found_error')
      redirect_to( meetings_current_path() ) and return
    end
    send_data(                                      
        csi_2_csv.output_text,
        type: 'text/csv',
        filename: @meeting.get_data_import_file_name('isc', 'csv')
    )
  end
def export_csi_csv unless TeamManagerValidator . can_manage? ( current_user , @meeting ) flash [ :error ] = I18n . t ( 'meeting.errors.invalid_team_manager_or_no_swimmer' ) redirect_to ( meetings_current_path ( ) ) and return end unless ReservationsCsi2Csv . is_a_csi_meeting ( @meeting ) flash [ :error ] = I18n . t ( 'meeting_reservation.export_csi_csv_invalid_meeting_error' ) redirect_to ( meetings_current_path ( ) ) and return end csi_2_csv = ReservationsCsi2Csv . new ( @meeting , @team ) csi_2_csv . collect ( ) if csi_2_csv . csi_data_rows . size < 1 flash [ :warning ] = I18n . t ( 'meeting_reservation.export_csi_csv_no_reservations_found_error' ) redirect_to ( meetings_current_path ( ) ) and return end send_data ( csi_2_csv . output_text , type : 'text/csv' , filename : @meeting . get_data_import_file_name ( 'isc' , 'csv' ) ) end
Collects the reservation data for the specified Meeting ID and outputs a
custom CSV text file, used as exchange data format in between C.S.I.
Collects the reservation data for the specified Meeting ID and outputs a custom CSV text file used as exchange data format in between C . S . I .
# == Send the collected data: