app/controllers/ops_controller/settings.rb
# Apply the good records from an uploaded import file
Apply the good records from an uploaded import file
Apply the good records from an uploaded import file
def apply_imports
    if session[:imports]
      begin
        session[:imports].apply
      rescue => bang
        add_flash(_("Error during 'apply': %{error}") % {:error => bang}, :error)
        @sb[:show_button] = true
      else
        add_flash(_("Records were successfully imported"))
        @sb[:show_button] = false
        session[:imports] = @sb[:imports] = nil
      end
    else
      add_flash(_("Use the Choose file button to locate CSV file"), :error)
      @sb[:show_button] = true
    end
    flash_to_session
    redirect_to(:action => 'explorer', :no_refresh => true)
  end
def apply_imports if session [ :imports ] begin session [ :imports ] . apply rescue => bang add_flash ( _ ( "Error during 'apply': %{error}" ) % { :error => bang } , :error ) @sb [ :show_button ] = true else add_flash ( _ ( "Records were successfully imported" ) ) @sb [ :show_button ] = false session [ :imports ] = @sb [ :imports ] = nil end else add_flash ( _ ( "Use the Choose file button to locate CSV file" ) , :error ) @sb [ :show_button ] = true end flash_to_session redirect_to ( :action => 'explorer' , :no_refresh => true ) end
Apply the good records from an uploaded import file
Apply the good records from an uploaded import file