small fix for import of journal
This commit is contained in:
parent
e883a9cae5
commit
4af43b8905
|
@ -82,17 +82,17 @@ module Admin::JournalPapersHelper
|
||||||
when 13
|
when 13
|
||||||
jls = JournalLevel.asc(:created_at).all.to_a
|
jls = JournalLevel.asc(:created_at).all.to_a
|
||||||
ts = val.to_s.split(",")
|
ts = val.to_s.split(",")
|
||||||
ts.each do |t|
|
ts.each do |t|
|
||||||
jp.journal_level_ids << jls[t.to_i].id
|
jp.journal_level_ids << jls[t.to_i].id if t.is_i? && t.to_i < jls.count
|
||||||
end
|
end
|
||||||
when 14
|
when 14
|
||||||
jpts = JournalPaperType.asc(:created_at).all.to_a
|
jpts = JournalPaperType.asc(:created_at).all.to_a
|
||||||
jp.journal_paper_type = jpts[val.to_i]
|
jp.journal_paper_type = jpts[val.to_i] if val.is_i? && val.to_i < jpts.count
|
||||||
when 15
|
when 15
|
||||||
jpas = JournalPaperAuthorType.asc(:created_at).all.to_a
|
jpas = JournalPaperAuthorType.asc(:created_at).all.to_a
|
||||||
ts = val.to_s.split(",")
|
ts = val.to_s.split(",")
|
||||||
ts.each do |t|
|
ts.each do |t|
|
||||||
jp.journal_paper_author_type_ids << jpas[t.to_i].id
|
jp.journal_paper_author_type_ids << jpas[t.to_i].id if t.is_i? && t.to_i < jpas.count
|
||||||
end
|
end
|
||||||
when 16
|
when 16
|
||||||
jp.number_of_authors = val
|
jp.number_of_authors = val
|
||||||
|
|
|
@ -59,7 +59,6 @@ wb.add_worksheet(name: "Journal Paper") do |sheet|
|
||||||
row << t("personal_journal.level_type")
|
row << t("personal_journal.level_type")
|
||||||
row1 << "checkbox"
|
row1 << "checkbox"
|
||||||
t = ""
|
t = ""
|
||||||
keys = []
|
|
||||||
JournalLevel.asc(:created_at).each_with_index do |jl,i|
|
JournalLevel.asc(:created_at).each_with_index do |jl,i|
|
||||||
t = t + "#{i}" + " -> " + jl.title + ", "
|
t = t + "#{i}" + " -> " + jl.title + ", "
|
||||||
end
|
end
|
||||||
|
@ -73,7 +72,6 @@ wb.add_worksheet(name: "Journal Paper") do |sheet|
|
||||||
row << t("personal_journal.paper_type")
|
row << t("personal_journal.paper_type")
|
||||||
row1 << "select"
|
row1 << "select"
|
||||||
t = ""
|
t = ""
|
||||||
keys = []
|
|
||||||
JournalPaperType.asc(:created_at).each_with_index do |jl,i|
|
JournalPaperType.asc(:created_at).each_with_index do |jl,i|
|
||||||
t = t + "#{i}" + " -> " + jl.title + ", "
|
t = t + "#{i}" + " -> " + jl.title + ", "
|
||||||
end
|
end
|
||||||
|
@ -87,7 +85,6 @@ wb.add_worksheet(name: "Journal Paper") do |sheet|
|
||||||
row << t("personal_journal.author_type")
|
row << t("personal_journal.author_type")
|
||||||
row1 << "checkbox"
|
row1 << "checkbox"
|
||||||
t = ""
|
t = ""
|
||||||
keys = []
|
|
||||||
JournalPaperAuthorType.asc(:created_at).each_with_index do |jl,i|
|
JournalPaperAuthorType.asc(:created_at).each_with_index do |jl,i|
|
||||||
t = t + "#{i}" + " -> " + jl.title + ", "
|
t = t + "#{i}" + " -> " + jl.title + ", "
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue