Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update csvfiles_controller.rb #2743

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions app/controllers/csvfiles_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
class CsvfilesController < ApplicationController
require 'digest/md5'

def active_userids_and_transcribers
syndicate = @user.syndicate
syndicate = session[:syndicate] unless session[:syndicate].nil?
@people = []
@people << @user.userid
if session[:manage_user_origin] == 'manage syndicate'
@userids = UseridDetail.syndicate(syndicate).active(true).all.order_by(userid_lower_case: 1)
load_people(@userids)
elsif %w[county_coordinator master_county_coordinator syndicate_coordinator country_coordinator system_administrator technical data_manager
volunteer_coordinator documentation_coordinator executive_director project_manager].include?(session[:role])
@userids = UseridDetail.active(true).all.order_by(userid_lower_case: 1)
load_people(@userids)
else
@userids = @user
end
end

def create
# Initial guards
redirect_back(fallback_location: new_csvfile_path, notice: 'You must select a file') && return if params[:csvfile].blank? || params[:csvfile][:csvfile].blank?
Expand Down Expand Up @@ -99,6 +116,7 @@ def edit
if @app == 'freecen'
@types_of_processing = ['Information', 'All Warnings', 'No POB Warnings', 'Error']
@type_of_processing = 'No POB Warnings'
active_userids_and_transcribers
end
end

Expand All @@ -116,6 +134,7 @@ def new
if @app == 'freecen'
@types_of_processing = ['Information', 'All Warnings', 'No POB Warnings', 'Error']
@type_of_processing = 'No POB Warnings'
active_userids_and_transcribers
end
@action = 'Upload'
end
Expand Down